Re: g_spawn*() on windows

2014-07-03 Thread Vivien Malerba
I get it. Did you add the -mwindows flag when linking your exe?

Vivien


On 3 July 2014 15:33,  wrote:

> Hi Vivien,
>
> Yes, I'm doing that. It all works and I can capture stdout and stderr
> from the convert.exe I'm running, it's just that I get a very annoying
> command window flash on the screen each time.
>
> If anyone has any ideas about the command window, I'm all ears :-(
>
> John
>
>
>
>
>
> On 3 July 2014 14:26, Vivien Malerba  wrote:
> > Hi!
> > From memory you need a copy the gspawn-win32-helper.exe executable (in
> your
> > %PATH% I guess).
> > Regards,
> > Vivien
> >
> >
> > On 3 July 2014 14:25,  wrote:
> >>
> >> Hi all,
> >>
> >> I'm using g_spawn_command_line_sync() to run a series of command-line
> >> programs (actually ImageMagick's convert, if that's important).
> >>
> >> It works fine, but on Windows I get an incredibly annoying console
> >> window flash up for a fraction of a second for each command. Does
> >> anyone have any good ideas for hiding this?
> >>
> >> From a bit of reading it seems that the glib helper program might need
> >> to be changed: it uses _wspawnv() to start the command and this will
> >> (I think) always show a console window for a console program. Is this
> >> right?
> >>
> >> John
> >> ___
> >> gtk-app-devel-list mailing list
> >> gtk-app-devel-list@gnome.org
> >> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
> >
> >
>
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: g_spawn*() on windows

2014-07-03 Thread Vivien Malerba
Hi!
>From memory you need a copy the gspawn-win32-helper.exe executable (in your
%PATH% I guess).
Regards,
Vivien


On 3 July 2014 14:25,  wrote:

> Hi all,
>
> I'm using g_spawn_command_line_sync() to run a series of command-line
> programs (actually ImageMagick's convert, if that's important).
>
> It works fine, but on Windows I get an incredibly annoying console
> window flash up for a fraction of a second for each command. Does
> anyone have any good ideas for hiding this?
>
> From a bit of reading it seems that the glib helper program might need
> to be changed: it uses _wspawnv() to start the command and this will
> (I think) always show a console window for a console program. Is this
> right?
>
> John
> ___
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
>
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: UUID Library for Gnome apps

2013-05-30 Thread Vivien Malerba
Hi!

I use the libuuid library (uuid-dev and uuid-runtime packages under Ubuntu).

Regards,

Vivien


On 30 May 2013 07:37, אנטולי קרסנר  wrote:

> Hello list,
>
> I'm writing a desktop app using Gnome technologies and I want to use
> UUIDs as means of generating URIs for resources.
>
> I found two UUID libraries: One is part of e2fsprogs, and the other one
> is provided by OSSP and has a C++ binding (perfect for me because I
> write in C++).
>
> I don't mind using a C library, but I'm not sure which UUID library is
> better for my app. The first one I mentioned, my whole system depends on
> it. And it's part of the Linux kernel. So I'm wondering, does using it
> create a dependency on Linux?
>
> And what is the recommended UUID to use? I see two options and I don't
> know how to choose. Choosing randomly would just create inconsistency,
> if each module "just chooses" one of them.
>
> regards,
> Anatoly
>
> ___
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
>
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Where to put graphic elements so I can find them again

2012-09-02 Thread Vivien Malerba
On 2 September 2012 23:04, Frank Cox  wrote:

> 1. I have a "custom" graphic that I'm showing as a sort of a placeholder or
> background in my mailing list program.
>
> 2. I see that most program-specific graphics on my computer seem to be
> located
> in /usr/share/pixmaps.
>
> Is it proper to put the custom graphic into /usr/share/pixmaps and just
> "assume" that it will be there, i.e use an absolute path to find it from
> within
> the program?
>
> If so, then how does  this integrate with a makefile using a ${prefix}
> macro?
> As soon as you change the prefix, you break the program unless you do some
> really fancy work with patch as part of the make, which seems awfully
> convoluted.
>
> If not, then how do you tell a program where to find this sort of graphic?
>  My
> best idea so far is to take argv[0] and using that as a starting point,
> assume
> that the graphic is located in a subdirectory branched off of that path,
> i.e.
> if the program is in /usr/local/bin then we hope the graphic will be in
>  /usr/local/share/pixmaps.
>
> Is there a better way to find a graphic background of this sort than
> specifying
> an absolute path and hoping to find it there?
>
>
You can also use Gio's Gresource for this purpose:
http://developer.gnome.org/gio/stable/gio-GResource.html

Regards,

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Examples of ComboBox using an explicit model?

2012-07-31 Thread Vivien Malerba
On 31 July 2012 00:12, James Tappin  wrote:

> I am currently trying to implement combobox cell renderers in the
> high-level gtk-fortran code. Unfortunately unlike "normal" comboboxes where
> there is the convenience type of GtkComboBoxText this is not available for
> cell renderers.
>
> I have hunted for examples of a working combobox that uses an explicit tree
> model without any success. Does anybody on this list have such an example
> (or even better, of a CellRendererCombo) that they would be willing to
> share.
>

You can have a look at the cell renderer I implemented for Libgda, cf
http://git.gnome.org/browse/libgda/tree/libgda-ui/data-entries/gdaui-data-cell-renderer-combo.hand
http://git.gnome.org/browse/libgda/tree/libgda-ui/data-entries/gdaui-data-cell-renderer-combo.c
.

This cell renderer displays a text, along with a down pointing triangle
which, when clicked, displays a combo box.

Hope this helps you,

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: How to draw GtkCellRendererCombo in (inside) a custom cell renderer?

2012-06-06 Thread Vivien Malerba
On 6 June 2012 09:51, Osmo Antero  wrote:

> Hello,
> I wanted to study the GtkCellRendererCombo so I added it directly to the
> treeview (as column).
> The combobox is initially hidden, only the "text" value is shown.
> The combo becomes visible after user clicks or double-clicks the column in
> the row.
>
> Unfortunately the click event does not work (or pass through) when the
> GtkCellRendererCombo is baked inside a custom-renderer class. Therefore it
> simply shows the "text" value, the combo-list itself is not accessible or
> visible.
>
> This might explain why GTK3 has NO renderer for very common type of
> widgets, like GtkButton.
> There is no GtkCellRendererButton class because it cannot handle the
> events.
>
> I may need to use the low-level painting functions directly, like
> gtk_paint_arrow(...)
> gtk_paint_shadow(...)
> gtk_paint_box(...)
> And somehow calculate the co-ordinates for click-events.
>
> Ref: http://developer.gnome.org/gtk3/3.4/GtkStyle.html
>
> All comments are welcome.
> // Osmo Antero
>
> /*
> Adding GtkCellRendererCombo directly (as column) to the treeview, just to
> study its behaviour.
>
> GtkTreeStore *store = gtk_tree_store_new(NUM_COLS,
>   G_TYPE_INT,
>   G_TYPE_POINTER,
>   G_TYPE_STRING); // <-- combo "text" field
> ...
>
> // Combo cell renderer (directly as column)
> renderer = gtk_cell_renderer_combo_new();
>
> GtkTreeIter iter;
> GtkListStore *combo_store = gtk_list_store_new (1, G_TYPE_STRING);
> gtk_list_store_append(combo_store, &iter);
> gtk_list_store_set(combo_store, &iter, 0, "First Item", -1);
> gtk_list_store_append(combo_store, &iter);
> gtk_list_store_set(combo_store, &iter, 0, "Second Item", -1);
>
> g_object_set (renderer, "editable", FALSE,
>"has-entry", TRUE,
>"model", combo_store,
>"text-column", 0,
>NULL);
>
> col = gtk_tree_view_column_new();
> gtk_tree_view_column_pack_start (col, renderer, TRUE);
> gtk_tree_view_column_add_attribute(col, renderer, "text", COL_2);
> gtk_tree_view_column_set_title (col, "Combo");
> gtk_tree_view_append_column(GTK_TREE_VIEW(tv),col);
> */
>
>
> On Tue, Jun 5, 2012 at 8:38 PM, Osmo Antero  wrote:
>
> > Hello,
> > I want to create my own cell-renderer for a treeview widget.
> > This custom cell will contain a text string and a combobox with some
> > values.
> > So my custom cell (row) contains both GtkCellRendererText and
> > GtkCellRendererCombo widgets.
> >
> > The cell renderer works well that it displays the text string, but the
> > combobox is *invisible*.
> >
> > In cell-renderer.c, I carefully get the size of the combobox:
> > gtk_cell_renderer_get_preferred_size(p->combo_renderer, widget, NULL,
> > &size);
> > combo_area.width = size.width;
> > combo_area.height = size.height;
> >
> > And then render it to cell with:
> > combo_area.x = title_area.x + title_area.width + GUI_PAD;
> > combo_area.y = fill_area.y + (fill_area.height - combo_area.height
> )/2;
> > gtk_cell_renderer_render(p->combo_renderer, window, widget,
> > background_area, &combo_area, flags);
> >
> > See the render_row(...) function in "cell-renderer.c" file.
> > But the p->combo_renderer (of type GtkCellRendererCombo) will not show
> up.
> >
> > The treeview row should display:
> >  "Node 1-0 text  [Combobox with values]"
> >  "Node 1-1 text [Combobox with values]"
> >  "Node 1-2 text [Combobox with values]"
> > ...
> > What could be wrong with my code?
> >
> > Here is a complete example of this:
> > http://www.futuredesktop.org/tmp/Test6.tar.gz
> >
> > Use the "m.sh" script to compile it:
> > $ ./m.sh
> >
> > Then run:
> > $ ./main
> >
> > You should see this:
> > http://bildr.no/view/1197967
> >
>
>
I've implemented a custom combo in a cell renderer for Libgda, see the code
at
http://git.gnome.org/browse/libgda/tree/libgda-ui/data-entries/gdaui-data-cell-renderer-combo.c
and specifically the  gdaui_data_cell_renderer_combo_start_editing() method.

Hope it helps you,
regards

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Need control of filename entry area in gtkfilechooser

2012-01-13 Thread Vivien Malerba
On 13 January 2012 04:34, Ferdinand Ramirez wrote:

> When I type in the filename into the filename entry area in gtkfilechooser
> dialog, I want to intercept the text that is entered, modify it and then
> display it in the filename area. How do I do this?
>
> For a regular text buffer, I know how to do this: I can do a
> gtk_text_view_get_buffer and then have a callback for insert-text. I can
> then modify the text that is entered and then insert it into the buffer,
> all from inside the callback.
>
> I want to be able to achieve the same thing for filename entry. Does
> anyone know how to do this?
>
>
I don't think the GtkFileChooser API allows you to do this. However maybe
you can connect to the "event" signal as the GtkFileChooser is a GtkWidget,
and do some things from there.

Regards,
Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: maybe known, maybe not...

2012-01-08 Thread Vivien Malerba
On 8 January 2012 03:49, Gary Kline  wrote:

>
> o am trying to have a "run" button fork off a new gvim and increase
> a global counter after the first gvim is closed.  my main gtk goes
> dark and nothing responds in this case.  i don't know if every
> distro of linux does this or if it [ this error indicator] only
> allpies to Ubuntu.
>
>
GLib has a whole collection of API to handle spawing processes, see
http://developer.gnome.org/glib/stable/glib-Spawning-Processes.html

Regards,

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: GLIB for a webserver

2011-12-08 Thread Vivien Malerba
On 8 December 2011 14:13, Marcelo Elias Del Valle - SYSMAP SOLUTIONS -
Claro MA-SP -  wrote:

> Hello,
>
>I am planning to use glib to write a C application server. I just
> like the library philosophy a lot and that’s why it is my first choice.
>However, after searching the web for a while, I have found some
> critics, which I list bellow:
>
> - On Apache ARP project, they said they created it instead of using glib
> because the lack of IPC functions like memory mapping.
> - In some forums, people were complaining about the fact glib aborts when
> memory allocation fails, which is bad for a 24/7 running web server.
>

If you write applications which don't leak memory, then you probably won't
have any problem. Also if your web server fails because it consumes too
much memory, this also probably means that either your HW is not strong
enough to support your web server or your web server is leaking memory, and
in this last case having it fail and restarting it is IMHO quite a good
idea (much better code than trying to handle failed memory allocations).


>
>I would like to know the opinion of those more experienced with
> glib. Do you recommend me to use it for writing a web server?
>

Please have a look at the LibSoup library, I've used it before for a small
embedded web server (in Libgda's console's tool) and it worked quite well,
but it really depends on what you want to do.

Regards,

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: g_spawn_async and Windows service

2011-11-06 Thread Vivien Malerba
On 6 November 2011 20:31, Tomáš Šoltys wrote:

>  Thanks for help, but this is not the case. If I disable "service"
> commands in my application, then the command line program gets executed
> without any problem.
>

This is a good starting point then to understand what fails. I'm sorry I
cant' help you more on this front.


>
> This also leads me to another question I have.
> Is it possible to execute the program in the background? Because as it is
> done currently a new window (command line window) will appear and program
> displays its output there.
>

If you don't want the program to create a new command line window when you
run it, you need to pass the " -mwindows" compile flag to gcc when you
compile it.

Regards,

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: g_spawn_async and Windows service

2011-11-05 Thread Vivien Malerba
On 4 November 2011 23:05, Tomáš Šoltys wrote:

> Hi all,
>
> I have created a windows service from which I would like to execute a
> command line program.
> I am trying to use g_spawn_async function.
>
> For to me unknown reason this is not working. Can someone please explain
> me why and whether it is possible?
>
> This is the returned error: "Failed to read from child pipe (EOF)"
>

This reminds me of a similar problem I once had because I had forgotten to
distribute the  gspawn-win32-helper.exe program as well, so make sure that
program is also available along with your binary.

Hope this helps,

Regards,

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: GLib with Flex and Bison

2011-10-03 Thread Vivien Malerba
On 3 October 2011 02:37, Craig  wrote:

> Hi,
>
> I have spent the past two weeks studying Flex and Bison.  It is great
> stuff!  I am about to try to use GLib in a Bison file, mainly calling
> functions on the GList Object.  I have never tried this before.  Will it
> work?  Are there any threading issues?
>
>
You can also use the lemon parser generator (http://www.hwaci.com/sw/lemon/)
which I find better to understand and use than Lex and Bison (no need for
external programs to compile, easier to understand, supports several
simultaneous parsing,...). It's the parser used (and made for) SQLite.
Libgda uses it extensively as well.

Regards,

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: g_win32_get_package_installation_directory_of_module()

2011-07-10 Thread Vivien Malerba
On 10 July 2011 21:01, John Emmas  wrote:

> If I write a program using gtk-win32 and I want it to discover its
> installation folder at run time, I can examine argv (if it's available).
>  Where it's not available however, I can call
> g_win32_get_package_installation_directory_of_module() passing it a NULL
> parameter.  Are there any equivalent API calls available for the OS-X and
> Linux platforms?
>
>
There is not such thing for Linux. For MacOSX there is something possible
AFAIK if your application is within a bundle (.dmg file).

Having had the same problem with Libgda, I reused/created some code to help
discover the actual location of the Libgda library at runtime, see
http://git.gnome.org/browse/libgda/tree/libgda/binreloc. Under Linux all the
magic is provided by some code copied form the Autopackage project.

Regards,

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: gtkLabel resize itself and resize the whole window

2011-05-31 Thread Vivien Malerba
gtk_label_set_ellipsize()?

Vivien

2011/5/31 Maxime de Roucy :
> Thanks for your answer.
>
> What I want exactly is :
> When the text in the GtkLabel is too long (it exceeds the widget size),
> I want the text to get cut off by the edge of the widget. Instead of
> increasing automatically the size of the Widget (and so the whole
> window).
>
> Le Tue, 31 May 2011 14:46:20 +0200,
> Emmanuel Thomas-Maurin  a écrit :
>
>> On 05/31/2011 12:32 PM, Maxime de Roucy wrote:
>> > Hello
>> >
>> > I have a Window containing
>> > (gtk_container_add(window, box);) a GtkBox (which is a GtkVBox in
>> > reality) ; this GtkBox containing a GtkHBox which contain a
>> > GtkLabel.
>> >
>> > With Gtk2 : "the text get cut off by the edge of the widget if it
>> > exceeds the widget size."
>> >
>> > But with Gtk3 the window extend itself when the text is too long.
>> >
>> > How can I avoid this behaviour ?
>> >
>> > I tried the set the window, the VBox and the HBox hexpand-set and
>> > vexpand-set properties to FALSE.
>> > But it doesn't change anything.
>> >
>> > I tried to set the Label gtk_label_set_max_width_chars  but it
>> > increase the heigh of the Label ...
>>
>> You may check out gtk_widget_set_size_request(). BTW, it's not clear
>> what you want to do exactly.
>>
>
>
> ___
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
>
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: how to connect the gnome aplication(gtk+) to database

2011-02-19 Thread Vivien Malerba
On 19 February 2011 09:22, angel kingdom  wrote:

> HI,
> i am working on a application(project Gutenberg ) which is written in gtk+
> and i want to connect this application with database server to store
> dictionary.i am having the Dictionary in xml format.
> So,please guide me or give me a link of how to do this work.
> I am using ubuntu 9.04
> And for database i am using the postgresql..
>
>
Depending on your needs, you can use the Libgda library (
http://www.gnome-db.org) which integrates well with Gtk+.

Regards,

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Application path

2011-01-18 Thread Vivien Malerba
On 18 January 2011 06:18, John Emmas  wrote:

> Thanks guys.  In fact, I only need this for the purpose of calculating a
> path that's relative to the location of the installed program.  It's of less
> importance on Linux because apps tend to be installed using the same path on
> everyone's system so generally, one can make an intelligent guess.  However,
> under Windows that's not necessarily the case.  I eventually solved it using
> g_win32_get_package_installation_directory_of_module(NULL) - but it didn't
> occur to me to check what happens if the app got started from a shortcut.
>  I'll check that later today.  I'm not entirely sure what to do under OS-X
> though.  From my limited knowledge of Macs I believe the situation is
> similar to Linux - i.e. the user gets no choice over where to install an
> app, so the path will typically be identical for most users.  Is that a
> reasonable assumption?
>
>
For Libgda, I use some code initially produced by AutoPackage to enable
binary relocation on Linux, Windows and MacOSX, see the code in
http://git.gnome.org/browse/libgda/tree/libgda/binreloc.

Regards,

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Help needed with offscreen window

2010-11-24 Thread Vivien Malerba
Hi all!

I want to create a GtkCellRenderer which renders a GtkWidget (each row
of the data model sets a property of the widget and it should render
differently). I face the problem that I can't force GTK+ to redraw the
widget before I get the pixmap from a GtkOffscreenWidget (that pixmap
is used "copied" into the cell area).

Attached is a small example which tries to render a GtkButton with
different labels for each row of a small data model.

Thanks for any help,

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: multithreading gtk app

2010-06-30 Thread Vivien Malerba
On 30 June 2010 02:57, Mick  wrote:
> can anyone point me to an explanation (with examples) to help me
> understand running some dialogs in separate threads. (eg. help,
> preferences, etc)

The general recommendation is to avoid using any GTK+ object from
different threads (because it does not work on Windows and from my own
experience it becomes very difficult to debug), but rather to devote
one thread to all the GTK+ objects, create other threads to do
specific jobs and have those threads communicate (using the GLib's
features).

Regards,

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Anyone for CMake?

2010-06-28 Thread Vivien Malerba
>From my own experience trying to have Libgda use CMake to compile,
CMake still lacks/badly supports some features which are available
using the autotools, such as:
* convenience libraries
* pkg-config support
For Libgda, this means I would have to reorganize much of my code,
which is a very complex task, not worth it considering that one can
cross compile for Windows if needed (or even natively compile using
mingw/msys). I also had some other troubles, notably the lack of
documentation, which made me stop trying to use it. Maybe I'll start
again in a future version of CMake.

However I understand the lack of support  for VisualX support as a
problem for potential contributors.

Regards,

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Connecting GTK application to a database

2010-02-23 Thread Vivien Malerba
On 23 February 2010 17:16, Tor Lillqvist  wrote:
>> Can somebody help me with connecting a gtk interface with a backend
>> database, say, Posgres? How does one embed SQL queries in the C code.?
>

The Libgda library provides an uniform access to databases using a
GObject oriented API. See http://www.gnome-db.org.

Note that the stable version only contains non UI features and the
unstable (read: being worked on) features some GTK+ based UI widgets.

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Bringing a GtkWindow to the current desktop with libwnck

2009-07-05 Thread Vivien Malerba
2009/7/3 Jim George 

> Hi all,
> I'm writing a program that needs to be "single-instance". The program
> will only run on gnome desktop machines. I'm using dbus to ensure
> this, by having the program try a dbus rpc each time it starts. If
> there's a running instance, it responds to the rpc by calling
> gtk_window_present on the main window. However, if the user switches
> desktops and tries to run another instance, gtk_window_present will
> only cause the window to appear on the previous desktop, not the
> current one.
>
> I tried to get around this using libwnck. I call
> wnck_window_get(GDK_WINDOW_XID(main_window->window)), but the
> WnckWindow returned is always NULL. The X window ID "seems" to make
> sense (it's a large integer), so what am I doing wrong?
>

You could use Libunique http://live.gnome.org/LibUnique for that purpose.

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Strange GHashTable behaviour

2009-04-21 Thread Vivien Malerba
2009/4/21 Luka Napotnik 

> Hello,
>
> I'm experiencing strange GHashTable behaviours when looking up a value
> throught a string key. I pass the key as a stack-allocated string to the
> hash table. For most lookups it works flawlessly but sometimes I get an
> invalid pointer. It even looks normal but data can't be accessed at that
> address.
>
> I have about 50 unique UUID keys and I'm inserting them to the hash
> table one by one with an associated data pointer. AFAIK,
> g_hash_table_lookup() should return NULL when the element with the
> provided key was not found in the table.
>
> So, does anyone have an idea what is going on here? Please help.


Is the problem on the key or on the returned value of a
g_hash_table_lookup()?

Did you give any destroy functions to g_hash_table_new_full() and use
g_hash_table_insert() again with the same key?

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: how to add button inside the treview list

2008-12-16 Thread Vivien Malerba
AFAIK, you can't display a button in a treeview column (no GtkCellRenderer
exist for this). Also having buttons for each row would make the treeview
not as much useable as it is now because each button would consume
ressources (memory and X ressources), and it is not how GtkCellRenders are
designed (they mainly only paint contents).

You'll have to write your own GtkCellRenderer to make it display whatever
you want and maybe the best is that the cell renderer display a button when
it is being edited (have a look at the GtkCellRendererText which adopts this
approach).

Vivien

2008/12/16 prasadam kumar 

> Hi,
>
> I am unable to find the way to add the button inside the treeview using GTK
> 'C' bindings.
> I am able to insert pixbuf,togglebuttons,processbar inside the treeview,
> but
> according to my requirement i have to put Button inside the treeview. I
> have
> not found any API  related to button with treeview.
>
> My requirement is:
> 1. I need three columns.
> 2. First column should be string so i can display the strings, rest of two
> columns I want to display buttons.
>
> Please some one help out how to solve this and feel free to giving the
> suggestions.
>
> Thanks in advance.
>
> Regards
> PPK
> ___
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
>
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: loading pixmaps from the C source

2008-10-22 Thread Vivien Malerba
2008/10/22 Henri Häkkinen <[EMAIL PROTECTED]>

> Hello,
>
> I am writing a simple GTK+ 2.0 application which uses the GNU build system.
> The application opens a status icon on the system tray area and the icon is
> loaded from a image file. By default, the icon gets installed to the usual
> location (/usr/local/$PACKAGE/pixmaps), but the user may choose to install
> the package to some other place by using --prefix etc. configure script
> options.
>
> What is the correct way of opening image files from the C source then? How
> do I know where the look for the installed data files?


I do this myself by getting the specified install path in the Makefile.am
file as #defines and using the path in the C code. For example see
http://svn.gnome.org/viewvc/libgnomedb/trunk/extra/Makefile.am?view=log

Also I've found that this method has its limit if the user actually installs
or copies the compiled version somewhere else, or if you want to compile for
Windows or Mac OS, in which case you can use a "binreloc" layer. For example
see http://svn.gnome.org/viewvc/libgnomedb/trunk/libgnomedb/binreloc/.

Regards,

Vivien


>
>
> --
> Henri Häkkinen
> ___
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: [gnome-db] how to print selected row in gnome_db_raw_grid?

2008-09-23 Thread Vivien Malerba
2008/9/23 paragasu <[EMAIL PROTECTED]>

> > gda_value_stringify(value)
>
> assume that i know, the value return is string, then i can simply use
> this function so i can print
> (GValue to gchar) the string.  but there is no function to conver
> GValue to gint or gfloat..


Yes, there are
g_value_get_int()
g_value_get_float()...


>
> the only function i can think of is gda_value_numeric but it doesn't do
> that.
>
> so assume that i know, that i have a double datatypes inside my table
> column, how i can get
> the value and assign it in a gdouble variable ?


mydouble = g_value_get_double (value);


>
>
> for example, if gchar,
>
> i can simply
> gchar *str;
> str = gda_value_stringfy ();


The gda_value_stringify() works for GValue of any type.

Cheers,

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: [gnome-db] how to print selected row in gnome_db_raw_grid?

2008-09-23 Thread Vivien Malerba
2008/9/23 paragasu <[EMAIL PROTECTED]>

> gda_data_model_iter_get_value_at is in V4
>
> can i do g_printf("%s", value) ?


No, you can't because value is a pointer to a GValue structure, not a
string.


>
>
> i am always confuse with the datatype GValue.. how to make sure it is
> of type char or integer?


use G_VALUE_TYPE (value), for example:
if (G_VALUE_TYPE (value)  == G_TYPE_STRING)
g_print ("%s\n", g_value_get_string (value));

You can also use gda_value_stringify(value) which will return a string to be
used for debug purposes.


>
>
> using try and error. i manage to print the value using
>
> list = GDA_PARAMETER_LIST (iter)->parameters;
> param = GDA_PARAMETER (g_slist_nth_data (list, 0));
> str = gda_parameter_get_value_str (param);
>
> i am not sure it is the best way. is there any other better way i can
> do it in V3?


It's the correct way. The returned string should take into account your
locale settings as well.


>
>
> thank you


You're welcome!
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: [gnome-db] how to print selected row in gnome_db_raw_grid?

2008-09-23 Thread Vivien Malerba
2008/9/23 paragasu <[EMAIL PROTECTED]>

> how to get the value from the selected row in gnome_db_raw_grid?
> so i can put it inside gtk_dialog
>

GdaDataModelIter *iter;
iter = gnome_db_data_widget_get_current_data (GNOME_DB_DATA_WIDGET
(raw_grid);
const GValue *value;
value = gda_data_model_iter_get_value_at (iter, your_column);

Cheers,

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: how to modify the GnomeDbDataWidgetInfo?

2008-09-19 Thread Vivien Malerba
2008/9/19 Daniel Espinosa <[EMAIL PROTECTED]>

> May be could be usefull to modify the code at GnomeDbDataWidgetInfo in
> order to add properties that allows to hide this objects, in order to share
> this functionality.
>

Yes, I'll note that on my TODO list.

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: how to modify the GnomeDbDataWidgetInfo?

2008-09-17 Thread Vivien Malerba
2008/9/17 paragasu <[EMAIL PROTECTED]>:
> by default, gnome_db_form/gnome_db_grid widget create a set of control
> (GnomeDbDataWidgetInfo). To add or manipulate data.
>
> For my application, i only need the update button, i do not need the
> insert, add or
> the next record button. How to remove all button except the update button?
>
> Or how i can create my update button to do function exactly like the one used 
> in
> the GnomeDbDataWidgetInfo update button.

Hidding buttons is not supported by the GnomeDbDataWidgetInfo widget.
However, there are several things you can do:
1) copy the source of GnomeDbDataWidgetInfo (rename it to be one of
your widgets) and remove the unnecessary code, then pack together a
GnomeDbRawGrid/Form with your new widget
2) pack a GnomeDbRawGrid/Form with a button of your own for which the
callback function will call
gnome_db_data_widget_perform_action(rawform/grid,
GNOME_DB_ACTION_WRITE_MODIFIED_DATA)
3) use gnome_db_data_widget_set_write_mode(rawform/grid,
GNOME_DB_DATA_WIDGET_WRITE_ON_VALUE_ACTIVATED) for example, in which
case you don't need any button at all

In any case you'll have to create a GnomeDbRawForm/Grid widget first.

Hope this will help you,

Vivien

BTW: please use the Gnome-DB mailing list for questions related to
libgda/libgnomedb.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: libgnomedb3.0: WARNING **: could expand "" into list of field

2008-09-01 Thread Vivien Malerba
2008/9/1 paragasu <[EMAIL PROTECTED]>:
> i am very new into this gtk and libgnomedb. this is my first attempt

Please post to the Gnome-Db list if your post is about Gnome-DB.

> write one, i have one
> function.
>
> [snip]
> GtkWidget *page_1(GdaConnection *conn)
> {
>GtkWidget *vbox;
>GdaQuery *query;
>GdaDict *dict = gda_dict_new();
>gda_dict_set_connection(dict, conn);
>
>query = gda_query_new_from_sql(dict, "SELECT * FROM account", NULL);
>GdaDataModel *acc_list_model = gda_data_model_query_new(query);
>g_object_unref(query);
>
>query = gda_query_new_from_sql(dict,
>"SELECT * from account"
>"WHERE acc_id=##/*name=:'acc_id' type:gint 
> descr:'account id'*/",
>NULL);
>
>GdaDataModel *payment_model = gda_data_model_query_new(query);
>g_object_unref(query);
>
>GdaParameterList *params =
> gda_data_model_query_get_parameter_list(GDA_DATA_MODEL_QUERY(payment_model));
>GdaParameter *param = gda_parameter_list_find_param(params, "acc_id");
>
>
>GtkWidget *grid = gnome_db_raw_grid_new(acc_list_model);
>GtkWidget *form = gnome_db_raw_form_new(payment_model);
>
>gtk_box_pack_start(GTK_BOX(vbox), grid, FALSE, FALSE, 3);
>gtk_container_add(GTK_CONTAINER(vbox), form);
>
>return vbox;
> }
>
> [/snip]
>
> the code compile well. except it give up warning  and segmentation fault.
>
> WARNING **: could  expand 'account.*' into list of fields

The (hidden and not obvious) reason is that the dictionary you use is
not up to date with the database structure, and specifically it knows
nothing about the "account" table. To solve this you can either make
sure the dictionary is up to date (use
gda_dict_update_dbms_meta_data()), or you can simlply re-write your
code and replace the '*' from "SELECT *..."  with the actual fields to
select.

BTW, if you are starting with the library on new code, I strongly
encourage you to use the last 3.99.x version as its API is far easier
to use and less buggy (the only disadvantage is that the API is not
yet stable but mostly).

Regards,

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: how to display photo in the GnomeDbGrid?

2008-08-26 Thread Vivien Malerba
2008/8/26 paragasu <[EMAIL PROTECTED]>:
> i am developing gtk application using libgnome-db and postgresql.
> i store photo as bytea inside one of the table column.
>
> how to display the photo using the gnomedbgrid?
> is it possible to do it?
>
> thank you

You can have a look at the gnome-db-demo program:
http://svn.gnome.org/viewvc/libgnomedb/trunk/extra/demos/grid_pict.c?view=log

Regards,

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: save image and display image from postgresql

2008-07-23 Thread Vivien Malerba
2008/7/23 paragasu <[EMAIL PROTECTED]>:
> i am very new to gtk programming. I am sorry for this beginner
> questions, but after asking
> google i fail the get the right answer. I hope this mailing list will help me.
>
> anyone can please point me a way on how to save image to postgresql
> database and
> display the image again.

To save an image in Postgres, you can sither use a blob type, a binary
string, or convert your picture to an ASCII string (in base64 for
example) and use a normal string field. Loading it back is a matter of
doing the reverse.

As to display the image in GTK+, you can use
gtk_image_new_from_pixbuf() along with a GdkPixbufLoader. This is
what's done in Libgnomedb (for example in
http://svn.gnome.org/viewvc/libgnomedb/trunk/libgnomedb/plugins/common-pict.c?revision=1686&view=markup).

Regards,

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: OpenGL interface

2008-01-04 Thread Vivien Malerba
On Jan 3, 2008 8:02 PM, Peter Hildebrandt <[EMAIL PROTECTED]> wrote:
>
> Happy new year everyone,
>
> I'd like to use opengl in my gtk application.  I've come across GtkGLArea
> [1] and GtkGLExt [2].  The former appears to be undocumented, while the
> latter is according to the website no longer actively maintained.
>
> Which one should I use?  Or is there a different solution out there?

You can have a look at Clutter (http://clutter-project.org/) which is
being actively developped.

Regards,

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: cairo canvas

2007-09-25 Thread Vivien Malerba
On 9/24/07, Gian Mario Tagliaretti <[EMAIL PROTECTED]> wrote:
> 2007/9/24, control H <[EMAIL PROTECTED]>:
>
> > Yes I saw this one, but since the last version is more than a year
> > old, I got the impression it's not really develloped anymore. Well,
> > maybe instead of premature it's just perfect! :) Anyway, thanks for
> > your link.
>
> The last release is not older then a month or so (0.9), the developer
> Damon Chaplin is actually working on something else but I still hope
> that goocanvas will be adopted as the next GtkCanvas.
>

I've started to use it myself for libgnomedb and even though it may
lack some features, it's still much better than the old gnome canvas;
I also hope it will be the base for the next GtkCanvas!

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Which widget to use for creating a list

2007-06-20 Thread Vivien Malerba
On 6/20/07, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> Hi,
> i m new to GTK+
> i am working on GTK+ with directfb on embedded platform.
> i want to have a list of say 4-5 items which can be selected by the
> direction keys..so that the selection moves to next one as u press the
> down key or moves up with the up key...
>
>
> I guess i need selectable text here..but i m not able to determine how to
> implement this in GTK..
> Plz help me out n suggest the widget structure.
> Thanks in advance.

I would use a GtkTreeView widget along with a GktListStore data model.

Regards,

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: GtkTreeView: different renderes within one row?

2007-05-31 Thread Vivien Malerba
On 5/30/07, Felix Kater <[EMAIL PROTECTED]> wrote:
> hi,
>
> I am new to GtkTreeView:
>
> Are cell renderers bound to columns or can they change between rows of
> the same column?

AFAIK cell renderers are defined once for each column, and are the
same for all the rows, but you can have more than one cell renderer in
each column.

>
> I'd like to create a two column list with simple text display on the
> left but each row having a different renderer on the right (combo,
> spin, entry).
>

I suggest you then create a custom cell renderer which will adapt
itself to the display you want for each row, and use that cell
renderer for the column on the right.

Regards,

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Plotting graphs

2007-05-24 Thread Vivien Malerba
On 5/24/07, Bluezapper <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Can someone refer me to an example  which plots a simple 2D graph using 
> gtkextra API.
>
>
> thanks,
>
> bluezapper.

A bit off topic, but there is also the GtkDatabox library out there (I
have not tested it though!)

Regards,

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Alternative GTK widgets

2007-05-16 Thread Vivien Malerba
On 5/16/07, beginner.c <[EMAIL PROTECTED]> wrote:
>
> Perhaps we should all put in some links - this would be beneficial for
> everybody I think (not all are still active/useful):
>
> http://dev.investorsidekick.com/begtkextra/
> http://libbit.sf.net/
> http://www.curlyankles.com/
> http://kornelix.squarespace.com/utilities/
> http://sourceforge.net/projects/enlightenment/ - gevas
> http://gtkadi.sourceforge.net/
> http://www.eudoxos.de/gtk/gtkdatabox/index.html
> http://sourceforge.net/projects/gtkcombogrid
> http://gtkdateentry.sourceforge.net/
> http://gtkmaskedentry.sourceforge.net/
> http://helm.cs.unibo.it/mml-widget/
> http://view.sourceforge.net/

You could also add http://www.gnome-db.org for database-bound widgets.

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Alternative GTK widgets

2007-05-14 Thread Vivien Malerba
On 5/12/07, Shoq <[EMAIL PROTECTED]> wrote:
>
> Pardon my noobness, but I am new to GTK.  I had assumed there would be a
> wealth of open source widgets that descend from the toolkit. I am starting
> to think this was a very poor assumption on my part.  I've not be able to
> find anything but a few aborted attempts at variations by other parties. Am
> I missing something? Is there are directory of other efforts to add value to
> the base classes?

What kind of widgets are you missing? Depending on you needs, there
are lots of widgets out there, but they are simply not integrated into
Gtk+.

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: How add a button widget to a cellrenderer ?

2007-04-13 Thread Vivien Malerba
On 4/11/07, Carlos Savoretti <[EMAIL PROTECTED]> wrote:
> Hi!
>
> I just need to add a gtkbutton to a pre-existing gtkcellrenderer,
> (it is the treeview is already created).
>
> That button will make some stuff referred to the cell within it
> is placed, it is because I need to pack it in the same cell.

Although it should be possible to add a widget into a custom made cell
renderer, I don't think it's a good idea because you'll lose the
"spirit" of the cell renderer.

However it's possible to place a widget in a cell renderer when the
cell is activated or edited (for instance the GtkCellRendererTest
places a GtkEntry when edited to allow modifications of the text).
Anyway, you'll have to write your own cell renderer for that (see for
example the cell renderers of libgnomedb).

Cheers,

Vivien
___
gtk-app-devel-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: GtkEntryCompletion on a GtkCellRendererText

2007-03-12 Thread Vivien Malerba
On 3/3/07, Philip Withnall <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I've got a table of database rows set up using a GtkTreeView with a
> GtkListStore backend, and GtkCellRendererTexts for the table cells. This
> is all working nicely.
>
> What I'd like to do is have auto-completion available when editing the
> text cells, with a GtkEntryCompletion, but I can't figure out how to add
> one. The most likely way would be to get a pointer to the
> GtkCellRendererText's GtkEntry, but I can't find a way to do that. I
> also can't find any gtk_cell_renderer_text_* methods for adding a
> GtkEntryCompletion, or an object equivalent to a GtkEntryCompletion for
> use on GtkCellRendererTexts.
>

If it's not too late, I'd suggest trying first to code your own cell
renderer based on the GtkCellRendererText (add a property to specify
the completion), and when it works, propose it as an evolution in
bugzilla.

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: manage a list

2007-02-23 Thread Vivien Malerba
On 2/22/07, Jerome Le Saux <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I would like to use a list in a scrolling windows in a gtk2 application.
> My items are the following :
> int Item number | string name | string extension | int length
>
> I saw int he API website I can use GtkItem and GtkListStore.
> How can I store each item in a GtkItem and feed my GtkListStore ?

GtkTree and GtkTreeItem are deprecated and you should not use them
anymore in your code. Use the new GtkTreeView widget with a
GtkListStore or GtrTreeStore object instead.

The GTK+ docs have a nice overview of how to use those objects (see
http://developer.gnome.org/doc/API/2.0/gtk/TreeWidget.html), and you
can use the examples in the gtk-demo program for some "live" code. I
don't know about the corresponding C++ API, but it should be fairly
identical (see http://www.gtkmm.org/docs/gtkmm-2.4/docs/tutorial/html/ch08.html
for example).

Regards,

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Application for finding all Windows

2007-02-21 Thread Vivien Malerba
On 2/21/07, Udayan Singh <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I want to develop an application where I can get a list of all the windows
> that are open in the GNOME Screen and find any activity being performed on
> any other window on the GUI screen (and not only my application) e.g.
> mouse click on window of another application sends me a signal.
>
> Any pointers of how I can go about doing the same ??
>

I've never done this, but I would start by looking how to interract
with the window manager using ICCCM and/or Extended Window Manager
Hints (http://www.freedesktop.org/wiki/Standards_2fwm_2dspec).

Regards,

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Catching the row deleted from a GtkTreeModel implementation

2007-02-09 Thread Vivien Malerba
On 2/9/07, Suma H.S <[EMAIL PROTECTED]> wrote:
> how r u deleting the row?
> It should be either through some key-press or mouse-click, in either case u
> must select the row before selecting.
> So...If it is through a key-press, catch the key-press signal and if it is
> through a mouse-click,
> catch mouse-click signal and access the selected row. Now do all the
> updations u want and then delete the row from the model.
>
>
>
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of Fontana Nicola
> Sent: Friday, February 09, 2007 2:36 AM
> To: gtk-app-devel-list@gnome.org
> Subject: Catching the row deleted from a GtkTreeModel implementation
>
>
> I'm keeping some summary fields of a GtkListStore and I need to update them
> on
> every model change. The problem is while catching the "row-deleted" signal
> the row is yet deleted, so I can't access the row content to update my
> summary fields.
>
> How can I do it?

I would suggest a different approach: add your own column to the
GtkListStore which stores your information summary as a GObject (so
you know when that object is destroyed).

If you can't add a column to the GtkListStore, then I suggest creating
another GtkTreeModel implementation which "proxies" the GtkListStore
and adds a new column (in this case you'll have to write a method to
delete data so you'll know when it's deleted) - see the
GtkTreeModelFilter implementation for example.

Regards,

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: black promt window

2007-02-05 Thread Vivien Malerba
On 2/4/07, Patrik Krizan <[EMAIL PROTECTED]> wrote:
> Hi,
> i'm newbie in gtk and i want develop applications on windows xp. i'm
> running gtk2.0, cygwin and eclipse. i compiled 'hello world' application
> (exact copied from tutorial) and it works fine. however, if i start it,
> i get a black promt window like this
> http://www.informatik.uni-frankfurt.de/~krizan/black_promt.jpg
> too. it is possible to avoid this black window?
> thanks
> patrik

>From an old thread, I found that you should use Mingw gcc with the
-mwindows flag to avoid having the command window open.

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: how to display a image with the size of parent widget

2007-01-26 Thread Vivien Malerba

On 1/26/07, 杨宇 <[EMAIL PROTECTED]> wrote:

I design a program  which is used for image display.(using glade 2)
In this program ,i use a notebook widget,the relation between notebook and
other widgets are as fallow:
notebook
-->page1
>image


->page2

i want to display the image in the whole window of page1,with a viewport
modifying the view of the image .

i use create_pixmap function of glade2 to creaste pixmap.

it's better if you have the code  of this function ,thank you!


I recently did something quite similar, it's in
http://svn.gnome.org/viewcvs/libgnomedb/trunk/libgnomedb/data-entries/plugins/
specifically in the gnome-db-entry-pict.c and common-pict.c files.

Regards,

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Load image from memory.

2007-01-02 Thread Vivien Malerba
On 1/2/07, Eirik Brandtzæg <[EMAIL PROTECTED]> wrote:
> I'm trying to include a image in my Free Pascal program under linux.
> First I loaded the image from a file using gtk_image_new_from_file, but I 
> want to have the picture inside the binary.
>

There is the GdkPixdata related API such as gdk_pixdata_to_csource().

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: how to free GList

2006-09-12 Thread Vivien Malerba
On 9/12/06, shibu Alampatta <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> Pls see the below code structure. how to free the glist at the indicated
> place?
>
> GList * glist=NULL;
>
> for(i=0;i
> 
> // some processing
> 
>
> //here want to free the glist
>

g_list_free (glist);

Note that this function will not free the memory pointed by each node.
If you have allocated memory, then you must free it first or risk some
memory leak.

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Pango Warning

2006-09-11 Thread Vivien Malerba
On 9/11/06, David Nečas (Yeti) <[EMAIL PROTECTED]> wrote:
> On Mon, Sep 11, 2006 at 10:51:17AM +0530, shibu Alampatta wrote:
> >  I'm using a combo box, code is given below
> >
> > char a[15];
> >
> > strcpy(a,"AAA");
> > glist_append(glist,a);
> >
> > It reports
> >
> > Pango Warning**: Invalid UTF-8 string passed to pango_layout_set_text()
>
> The posted code does not print this warning (try yourself)[*].
>
> The problem is elsewhere where you pass a non-UTF-8 encoded
> text, or maybe some random rubbish, to a Gtk+ function as
> a string.
>
> Yeti
>
>
> [*] It contains two probable bugs however, one is not using
> the return value of g_list_append() likely leading to a
> memory leak, another is the use of strcpy() prone to buffer
> overflows.

Also if you do this in a function call, the 'a' variable will lose its
scope and using it outside of the function will lead to problems.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Unsolved glib problem

2006-09-10 Thread Vivien Malerba
On 9/9/06, dagang001 <[EMAIL PROTECTED]> wrote:
>
> for ( i=0 ;i<4 ;i++)
> {
> Person *fred = g_new(Person, 1);
> /**/
> fred->name = ming[i];
> fred->shoe_size = i+10;
> fred->age=60+i;
> list = g_list_append(list, fred);
> }
>

Did you set list=NULL before that code?

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Database connection et al

2006-09-08 Thread Vivien Malerba
On 9/7/06, Andrea Zagli <[EMAIL PROTECTED]> wrote:
> Il giorno gio, 07/09/2006 alle 18.55 +0530, Sucheta Ghosh ha scritto:
> > Is this possible to connect gtk+ with mysql database or any other
> > database? If answer is "yes" then how is this possible?
>
> for example www.gnome-db.org

The website is out-dated, but a new version has come out recently,
check the download links.

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: How to save/load GtkTreeStore into a file?

2006-09-04 Thread Vivien Malerba
On 8/29/06, chabayo <[EMAIL PROTECTED]> wrote:
> Hello all,...
>
> ...i try to load a GtkTreeStore from a file that i was saving with
> gtk_tree_store_foreach calling a function inheritting
> gtk_tree_model_get_string_from_iter (the 0:0,0:1,1:0:0,... thing)
> and gtk_tree_model_get .
>
> Now it would be seem easy to me to be done with
> gtk_tree_model_get_iter_from_string and gtk_tree_store_set.
>
> The Problem is, by meaning, there is no node to iterate for the factive
> virtual node referenced by the string.
>
> Anyone could tell me the preferable way to save/load GtkTreeStores ??

It's not the GtkTreeStore but the GtkTreeModel which you need to save
and/or load. This depends on the data you have; I personally use XML
files which are quite well adapted to represent trees.

Regards,

vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Record/Playback GUI Operations

2006-08-24 Thread Vivien Malerba
On 8/25/06, Sai Laxmi K <[EMAIL PROTECTED]> wrote:
> Thanks Mr.Vivien,
>That site was extremely useful. But I have one problem in configuring. I
> know this query is not relevant to this post, but I'm not able to find any
> other means to solve this. When I'm configuring Xnee with Cygwin, it's
> throwing two errors,
>
>
>  ERROR 
>
> Could not locate the needed X11 extensions:
>
>RECORD
>XTest
>
> Make sure you have them installed before building Xnee
>
>
> Where can I find these two extensions and how can I include them in my
> Cygwin. Can you pl. help me.

These are the X server extensions, which you need to configure for
your X server running on Windows. I don't use windows so I can't help
you there, sorry. Maybe try to ask the cygwin guys...

Regards,

vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Record/Playback GUI Operations

2006-08-24 Thread Vivien Malerba
On 8/24/06, Sai Laxmi K <[EMAIL PROTECTED]> wrote:
>
> Hi,
>   I've developed an application with GTK. Now the requirement is that the
> key presses and button clicks should be recorded so that the user can
> play-back the test and get the results. Is there a way in GTK to accomplish
> this. Pl. give some advice to me on this.
>

There is the Xnee program which might be of interest to you then:
http://www.gnu.org/software/xnee/

Regards,

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Sockets in GTK+?

2006-08-21 Thread Vivien Malerba
On 8/21/06, Chris Sparks <[EMAIL PROTECTED]> wrote:
> I went looking fo rGNet and what is odd is that it says this:
>
> " It is written in C, object-oriented, and built upon GLib."
>
> C isn't object-oriented..
>

The C language does not object, however nothing prevents you from
having a Object oriented approach to programming, and the is exactly
what the GLib does with the GObject "object" (it supports single
inheritance, interfaces, properties, etc).

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Sockets in GTK+?

2006-08-21 Thread Vivien Malerba
On 8/20/06, n3ck <[EMAIL PROTECTED]> wrote:
> Hi every1!
> Im was delphi (win) coder for a while but now i use linux as OS.
> I really like to code so i choose GTK for build applications on linux.
> I have been searching for some tutorial, text or articule about how
> to build cliente/server apps using GTK but i could't find anything :(
> Somebody has some clue, url or something that helps me with this?
> thankz a lot.
> Best  Regards n3ck

I use the http://www.gnetlibrary.org/ library which works quite well
and is well integrated into the GLib main loop.

Regards,

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: GTK Wizard using Notebook

2006-03-22 Thread Vivien Malerba
On 3/22/06, 3saul <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I'm new to programing, especially gtk. I'm wanting to create a gtk wizard
> (without a dependency on Gnome - I'm aware of the druid). I thought the best
> way might be to create a notebook and have forward and back buttons cycle
> through the tabs. My question iscan someone give me some pointers on how
> to best cycle through the tabs??
>

You can also have a look at the GtkAssistant widget part of the Ridley
project. See
http://cvs.gnome.org/viewcvs/gtk%2B/gtk/gtkassistant.h?view=markup

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Containers for containers

2006-01-25 Thread Vivien Malerba
2006/1/25, Ephrem Boudonnet <[EMAIL PROTECTED]>:
> hi
> I'm searching a container which could contain other containers.
> For example, is that possible to add anywhere several layouts to a
> window, or to include a layout in another one, in order to use it as
> sub-windows I could drag and drop.
> Is there a way to make this?
> Thanx

Any container can contain GtkWidget widgets, and as a GtkContainer is
a GtkWidget, il can contain any other container (the number of
children widgets depends on its real nature). This allows to have
complex layouts.

Cheers,

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: how can include just glib

2005-12-13 Thread Vivien Malerba
2005/12/13, Fernando Apesteguía <[EMAIL PROTECTED]>:
> Did you try to make this?
>
> #include 
>
> And then link with
>
> -lglib-2.0 (link against your glib version)
>

You should use `pkg-config --cflags glib-2.0` to get the list of
include flags and `pkg-config --libs glib-2.0` to get the list of
liknong flags when compiling.

Cheers,

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: howto mix gtk and network

2005-12-09 Thread Vivien Malerba
2005/12/9, Alexander Nagel <[EMAIL PROTECTED]>:
> Hi,
> i plan to program a little game which also should playable over network
> and i need a some ideas for the beginning.
> I know the network basics.
> For example at the start of the game one player act as a server chooses
> the map and the number of max. players and other players can join.
> (Like in C&C Generals or HW2)
> So what i need is a function which polls regularly every 0.5 second or so
> at the given port.
>
> Any ideas are welcome

I use the GNet library and it works fine and integrates easily in the main loop:
http://www.gnetlibrary.org/

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Does such a widget exist?

2005-11-17 Thread Vivien Malerba
2005/11/16, Stefano Esposito <[EMAIL PROTECTED]>:
> Hi all,
>
> i need a widget that displays mobile/fixed points and fixed rectangles and 
> which is capable to catch mouse-click events. Does such a widget exist 
> somewhere in the world? :)
>

I think you can use libgnomecanvas for that job.

Regards,

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Opening GUI with SSH

2005-10-20 Thread Vivien Malerba
2005/10/20, Suganya <[EMAIL PROTECTED]>:
> Hi all,
>
> I upgraded my gtk from 2.0 to 2.8.
>
> Now I could not open GUI windows of other machines using SSH.
>
> Expecting suggestions.
>

Did you try ssh -X ?
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: g_io_channel

2005-07-08 Thread Vivien Malerba
On 7/8/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > I need to send a data structure over an io_channel. In the
> reference
> > manual, I found that the only available instruction to write data
> in a
> > channel is:
> >
> > GIOStatus   g_io_channel_write_chars(GIOChannel *channel,
> >  const gchar *buf,
> >  gssize count,
> >  gsize *bytes_written,
> >  GError **error);
> >
> > which needs a gchar* as the input data.. How can I send my data
> > structure with this command?
> 
> g_io_channel_write_chars(channel, (const gchar *)your_struct, sizeof
> (your_struct), &written, errors);

Beware however that depending on the contents of your structure, you
may have some problems if you exchange data this way between machines
which do not have the same endian-ness (if it's on the same machine,
then no problem!).

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Wrapped text in GtkTreeView

2005-06-15 Thread Vivien Malerba
On 6/15/05, Slou <[EMAIL PROTECTED]> wrote:
> Vivien Malerba wrote:
> >>I have list of a very long lines which I want to be accessible to user
> >>with no penalty (additional clicking etc.).
> >>
> >>So the solution is obvious - wrapped text in TreeView, but I found no
> >>way to create such CellRenderer.
> >>
> >>All discussions on this subject I found are at least a year old. What is
> >>the current state of this problem?
> >
> >
> > You can either:
> > -> add a "line_wrap" property to the GtkCellRendererText object, or
> 
> hmm... seems there is no such property for GtkCellRendererText [1]

I meant modifying the GtkCellRendererText source code in the GTK+
libraty itself (and maybe proposing a patch for inclusion?)

> 
> > -> create your own GtkCellRenderer object (see
> > http://scentric.net/tutorial/treeview-tutorial.html)
> 
> The problem when I try to create custom cell renderer is that I can't
> dynamically change it's height.
> 

There is no reason about that since height calculation is done by the
virtual functions you need to write to create a GtkCellRenderer.

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Wrapped text in GtkTreeView

2005-06-15 Thread Vivien Malerba
On 6/15/05, Slou <[EMAIL PROTECTED]> wrote:
> Hi!
> 
> I have list of a very long lines which I want to be accessible to user
> with no penalty (additional clicking etc.).
> 
> So the solution is obvious - wrapped text in TreeView, but I found no
> way to create such CellRenderer.
> 
> All discussions on this subject I found are at least a year old. What is
> the current state of this problem?

You can either:
-> add a "line_wrap" property to the GtkCellRendererText object, or
-> create your own GtkCellRenderer object (see
http://scentric.net/tutorial/treeview-tutorial.html)

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Instalation of GTK+ 2.6 alongside GTK+ 2.4

2005-06-09 Thread Vivien Malerba
On 6/8/05, Derrick J Houy <[EMAIL PROTECTED]> wrote:
> I run on Fedrora Core 3 which has GTK+ 2.4.13 installed. I want to
> continue to build my apps against the standard packages included in FC3,
> but also need to fix some bugs which allow the apps to work with GTK+ 2.6.7.
> 
> Can anyone help me with the best setup to easily allow building against
> the newer versions, without having to upgrade the current system version.
> 

To do something similar, here is what I do:
-> create a directory where to install the new GTK (/local/G_EXTRA for example)
-> in gtk+'s sources, run ./configure --prefix=/local/G_EXTRA (with
some other arguments if you want)
-> make; make install

Now you've got Gtk+ installed in /local/G_EXTRA, and need to set a few
environment variables if you want to use it (before running
./configure in your sources anyway):

LD_LIBRARY_PATH to /local/G_EXTRA/lib
PKG_CONFIG_PATH to /local/G_EXTRA/lib/pkgconfig
PATH to /local/G_EXTRA/bin
DEVHELP_SEARCH_PATH to /local/G_EXTRA/share/gtk-doc/html

and a few others for your own convenience. You can install other
programs and libraries as well (I installed the whole Gnome 2.10 this
way).

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


GtkFileChooserButton's mode

2005-05-17 Thread Vivien Malerba
Hi!

Does anybody know why the GtkFileChooserButton widget does not accept
the GTK_FILE_CHOOSER_ACTION_SAVE mode (or the
GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER mode)?

Thanks,

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: using GtkTextView as a single line editor widget?

2005-05-16 Thread Vivien Malerba
On 5/16/05, Vadim Berezniker <[EMAIL PROTECTED]> wrote:
> I tried unsuccessfully to use the GtkTextView as a single line text
> editor widget. I need to use some of the features provided by
> GtkTextView/GtkTextBuffer so I cannot use GtkEntry.
> Right now I have the text wrap which causes the text box to expand
> vertically. I tried turning off wrapping and putting it inside a
> Scrolled Window and that didn't quite work.
> 
> Also, is there any tips on writing more effecient code that uses
> GtkTextBuffer? It seems that applying tags is a performance killer.
> I've been trying to make my code faster, but it seems I cannot do
> anything to make GtkTextBuffer faster.

If you are trying to make a kind of console from GtkTextView (like
with the readline library for command line applications), then I've
managed to do something quite close to that (it's a SQL console
widget), see the code at
http://cvs.gnome.org/viewcvs/libgnomedb/libgnomedb/gnome-db-sql-console.c?rev=1.2&view=markup

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: TreeView and Pixbuf

2005-05-16 Thread Vivien Malerba
On 5/13/05, Denis <[EMAIL PROTECTED]> wrote:
> how i can change pixbuf in gtk_tree_view?
> --

Just change it in the model, and the tree view will automatically update itself.

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: GtkTreeView SIGNALS

2005-05-03 Thread Vivien Malerba
On 5/3/05, John Coppens <[EMAIL PROTECTED]> wrote:
> On Tue, 3 May 2005 10:11:49 -0400
> André Pedralho <[EMAIL PROTECTED]> wrote:
> 
> > I'm trying to use the single click on a GtkTreeView. Is there a way
> > for me? The row-activated signal is activated with a double click...
> > I'm needind one that is launched with just one click!
> 
> Check 'cursor_changed' - that's normally the one you want.
> 

There is also as a last possibility the GtkWidget's "event" signal.

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: GTK window and thread

2005-05-03 Thread Vivien Malerba
On 5/2/05, Frederic Beck <[EMAIL PROTECTED]> wrote:
> Hello
> 
> Here's my problem : i have a daemon running in the background, and i
> want it to show popups after some events.
> 
> I'm new in using GTK, so i took a look at the tutorial, and i managed to
> create the window and show it. The popup window is closed when pressing
> on a button.
> 
> As i don't want this popup to be blocking for the daemon, i wanted to
> put it in a thread using pthread.
> 
> After a few tries, i managed to make it work, which means, i can show
> multiple windows at the same time and close them independently.
> 
> To do so, in the function which shows the popup window, i have the
> initialisation of the window, and then the following liness :
> 
> gtk_main ();
> while (gtk_events_pending())
> gtk_main_iteration();
> 
> and a quit handler is associated to the button and contains :
> 
> gtk_main_quit ();
> 
> I have 2 questions :
> 
> 1. When running it works, but i have lots of messages like :
> 
> (:20080): GLib-WARNING **: g_main_context_check() called
> recursively from within a source's check() or prepare() member.
> 
> (:20080): GLib-WARNING **: g_main_context_prepare() called
> recursively from within a source's check() or prepare() member.
> 
> 2. (more about pthread i guess) i don't want to add a join in my
> program, i just want the thread to show the window and stop when the
> button is clicked. That's why, after everything is done, i added a
> ptrhead_exit(NULL) call, but even after the window has been closed, i
> still have processes  :
> 
> 20287 pts/1Z  0:00  \_ [sh] 
> 20292 pts/1Z  0:00  \_ [sh] 
> 20296 pts/1Z  0:00  \_ [sh] 
> 20302 pts/1Z  0:00  \_ [sh] 
> 
> i have 4 such processes for each window opened. Am i doing something
> wrong with GTK or pthread ?
> 

You can create a thread (using GLib threads handling functions) in
which _only_ the deamon works, and one thread for _all_ GTK related
stuff. You need to call g_thread_init() but you don't need to call
gtk_threads_init() since the GTK main loop remains in a single thread
and from GTK, you only have one thread. This way you have a real
separation of the daemon part and the GUI part.

You must make sure though that no GTK+ call is made from within any
GLib callback in the thread running the daemon: I use a GAsyncQueue to
make the two threads communicate: the daemon thread "writes" to the
queue when it has an event, and the GTK thread has an idle function
(see g_idle_add) which reads from that queue and updates the GUI.

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: g_signal_connect

2005-05-03 Thread Vivien Malerba
On 5/3/05, Tomaz Canabrava <[EMAIL PROTECTED]> wrote:
> Little trouble here =)
> 
> the g_signal_connect works like what?
> g_signal_connect(GTK_WIDGET(widget), signal("clicked"),
> G_CALLBACK(Function), (gpointer) "Data");
> 
> but the callbacks functions have the GtkWidget *Widget as a 1st
> parameter, and...
> well, i simply don't get it. =)
> 
> Does anyone cares to explain to this little noob the arts and secrets
> of the g_signal_connect?

Your callback function should have the following declaration:
void my_callback (GtkWidget *widget, gpointer my_data);

the 'widget' argument is set to the button on which the user clicked,
and 'my_data' is the pointer to your "Data" string. You don't need to
use the 'widget' argument in you callback function, though.

Callback functions always have their first argument as the object
which emitted the signal, and the last one as the data pointer you
pass when you call g_signal_connect().
The arguments in between the two depend on the actual signal being
emitted, and relate to the signal itself; they are set by the GObject
framework by the code actually emitting the signal.

Hope this helps,

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: GList

2005-05-03 Thread Vivien Malerba
On 5/2/05, Городничев  Денис <[EMAIL PROTECTED]> wrote:
> i think that the result of next code must be 3.
> but i have 0
> if uncomment "l=..." it's work correctly
> 
> #include 
> 
> int main()
> {
> GList* l=NULL;
> //l=g_list_alloc();
> 
> g_list_append(l,GINT_TO_POINTER(1));
> g_list_append(l,GINT_TO_POINTER(1));
> g_list_append(l,GINT_TO_POINTER(1));
> 
> printf("%i",g_list_length(l));
> }

use:
l = g_list_append(l,GINT_TO_POINTER(1));

instead of:
g_list_append(l,GINT_TO_POINTER(1));

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: [Beginner] How to write at the end of a GtkTextBuffer ?

2005-04-24 Thread Vivien Malerba
On 4/23/05, Olivier Ramare <[EMAIL PROTECTED]> wrote:
> Dear all,
> 
>I have troubles understanding (and controlling) where
> to write on a GtkTextBuffer. Here are my variables :
> 
>SGinfosbuffer=gtk_text_buffer_new(NULL);
>SGinfos=gtk_text_view_new_with_buffer(SGinfosbuffer);
>SGscrolledinfos=gtk_scrolled_window_new(NULL,NULL);
>gtk_container_add(GTK_CONTAINER(SGscrolledinfos),SGinfos);
> 
> and I write in it via:
> 
> void SG_print_infos(char *letexte)
> {
>  gtk_text_buffer_insert_at_cursor (SGinfosbuffer,letexte,-1);
>  while (gtk_events_pending()) gtk_main_iteration(); /* flush */
>  gtk_widget_show_all(SGinfos);
> }
> 
> All goes well until the text in  SGinfosbuffer gets out of the
> viewed area. Then some messages are repeated, and some times
> when I scroll the buffer down I discover the text has been
> inserted at uncanny places (almost reversed order sometimes).
> 
> What I want :
>-- the info written always at the end of the buffer
>-- this end should be in the viewable area (scroll if needed).
> I can't quite get an inkling as to this last one either :-(
> 

I wrote a SQL console widget which has the same usage as the one you
mention here. You can have a look at the code in the
http://cvs.gnome.org/viewcvs/libgnomedb/libgnomedb/gnome-db-sql-console.c?rev=1.2&view=markup
file.

Cheers,

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Callbacks from an idle function

2005-04-08 Thread Vivien Malerba
On Apr 8, 2005 6:13 PM, Peter Bloomfield <[EMAIL PROTECTED]> wrote:
> On 04/08/2005 11:41:57 AM, Vivien Malerba wrote:
> > On Apr 8, 2005 5:26 PM, Peter Bloomfield
> > <[EMAIL PROTECTED]> wrote:
> [ snip ]
> >> Perhaps you're trying to use gdk_threads_enter recursively?  Instant
> >> lock...
> >>
> >>
> >
> > I did not use gdk_threads_enter()/gdk_threads_leave() when I posted
> > the message.
> 
> Oh, well, *there*'s the problem!

I thought that gdk_threads_enter()/gdk_threads_leave() were only to
solve multi-threads problems, I don't see why they would be needed if
there is only one thread!
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Callbacks from an idle function

2005-04-08 Thread Vivien Malerba
On Apr 8, 2005 5:26 PM, Peter Bloomfield <[EMAIL PROTECTED]> wrote:
> On 04/08/2005 10:22:59 AM, Vivien Malerba wrote:
> [ snip ]
> > However, still from the same function, I then destroy the custom
> > widget, and the whole application locks. A backtrace from gdb attached
> > to the locked application gives:
> > (gdb) bt
> > #0  0x00ad37a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
> > #1  0x00d3913e in __lll_mutex_lock_wait () from
> > /lib/tls/libpthread.so.0
> > #2  0x00d35d9b in _L_mutex_lock_32 () from /lib/tls/libpthread.so.0
> > #3  0x in ?? ()
> 
> Perhaps you're trying to use gdk_threads_enter recursively?  Instant
> lock...
> 
> 

I did not use gdk_threads_enter()/gdk_threads_leave() when I posted the message.

I fact I have managed to make it work somehow by adding
gdk_threads_enter() before the first line of code in my idle function
and gdk_threads_leave() at the end.

Strange considering I have obly one thread!

I'm still trying to see if there are some strange behaviours with that
situation...

Thanks,

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Callbacks from an idle function

2005-04-08 Thread Vivien Malerba
Hi!

I would appreciate having a bit of help concerning a strange problem.

In an application I'm writing (Mergeant), I have enabled
multi-threading (g_thread_init() and gtk_threads_init()), but I'm
using it with one thread only.

I have an idle function callback from which I create:
* one custom object which sends a signal about some auto-generated events
* a custom widget which is connected to this signal and updates its display

>From the same idle function, I make the custom object emit the signals
and the custom widget is updated correctly. Everything is OK.

However, still from the same function, I then destroy the custom
widget, and the whole application locks. A backtrace from gdb attached
to the locked application gives:
(gdb) bt
#0  0x00ad37a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1  0x00d3913e in __lll_mutex_lock_wait () from /lib/tls/libpthread.so.0
#2  0x00d35d9b in _L_mutex_lock_32 () from /lib/tls/libpthread.so.0
#3  0x in ?? ()

The strange thing is that if I don't create the custom widget, then
everything runs OK.

Any idea how to solve this problem?

Thanks a lot,

Vivien
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list