GdkPixmap and GdkPixbuf

2005-06-06 Thread y g
Hi, after following the scribble example on the Gtk tutorial I try to save the image produced. Looking on the documentation of GdkPixbuf I found I could use the following which however gives me a segmentation fault in my program. static GdkPixmap *pixmap = NULL;

Re: GdkPixmap and GdkPixbuf

2005-06-06 Thread David Necas (Yeti)
On Mon, Jun 06, 2005 at 03:22:51PM +0100, y g wrote: after following the scribble example on the Gtk tutorial I try to save the image produced. Looking on the documentation of GdkPixbuf I found I could use the following which however gives me a segmentation fault in my program. static

Re: GdkPixmap and GdkPixbuf

2005-06-06 Thread y g
On 6/6/05, David Necas (Yeti) [EMAIL PROTECTED] wrote: On Mon, Jun 06, 2005 at 03:22:51PM +0100, y g wrote: after following the scribble example on the Gtk tutorial I try to save the image produced. Looking on the documentation of GdkPixbuf I found I could use the following which however

Re: GdkPixmap and GdkPixbuf

2005-06-06 Thread David Necas (Yeti)
On Mon, Jun 06, 2005 at 03:52:32PM +0100, y g wrote: I already did as I realised that neither is a child of the other as you say. But I am still get seg fault with the following: static void save_image(GtkWidget* widget, gpointer user_data) { GdkPixbuf* pixbuf; g_print(Saving

Clarification about gtk_main() and running simultaneous non-gtk functions

2005-06-06 Thread Michal Porzuczek
Correct me if I'm wrong but the gtk_main() acts like an infinite while loop that waits for callbacks to the widgets that have been created before gtk_main() was called. My question is, except for the g_timer function which seems to just be for measuring proccesses inside actual callbacks, is it

Re: GdkPixmap and GdkPixbuf

2005-06-06 Thread y g
On 6/6/05, David Necas (Yeti) [EMAIL PROTECTED] wrote: On Mon, Jun 06, 2005 at 03:52:32PM +0100, y g wrote: I already did as I realised that neither is a child of the other as you say. But I am still get seg fault with the following: static void save_image(GtkWidget* widget, gpointer

Re: GdkPixmap and GdkPixbuf

2005-06-06 Thread David Necas (Yeti)
On Mon, Jun 06, 2005 at 04:21:33PM +0100, y g wrote: ok i see what you mean... but the following still seg faults... no warnings this time... static void save_image(GtkWidget* widget, gpointer user_data) { GdkPixbuf* pixbuf; g_print(Saving image...\n);

Memory problems with gdk_pixbuf

2005-06-06 Thread John Coppens
Hello people. A few weeks ago I posted a message about memory leaking. I haven't solved the problem yet (thanks for a few privately received suggestions though). The example below is taken largely from the GGAD manual, but, if the segment is called repeatedly, allocates large chunks of memory,

Re: Clarification about gtk_main() and running simultaneous non-gtk functions

2005-06-06 Thread Tristan Van Berkom
Michal Porzuczek wrote: Correct me if I'm wrong but the gtk_main() acts like an infinite while loop that waits for callbacks to the widgets that have been created before gtk_main() was called. gtk_main will run a GMainLoop:

Re: Clarification about gtk_main() and running simultaneous non-gtk functions

2005-06-06 Thread Paul Pogonyshev
Michal Porzuczek wrote: Correct me if I'm wrong but the gtk_main() acts like an infinite while loop that waits for callbacks to the widgets that have been created before gtk_main() was called. It is true to some extent. It is an infinite, but terminatable loop that waits for events (most

Re: Memory problems with gdk_pixbuf

2005-06-06 Thread Tristan Van Berkom
John Coppens wrote: Hello people. A few weeks ago I posted a message about memory leaking. I haven't solved the problem yet (thanks for a few privately received suggestions though). The example below is taken largely from the GGAD manual, but, if the segment is called repeatedly, allocates

Re: GdkPixmap and GdkPixbuf

2005-06-06 Thread y g
Well, I can't see why this variant crashes -- so I compiled it and run under valgrind, and it didn't crash and valgrind even didn't print any (relevant) error. If other image formats crash too for you, you probably have to use debugger to find out what's going on... OK, lets start from

Re: Memory problems with gdk_pixbuf

2005-06-06 Thread John Coppens
On Mon, 06 Jun 2005 14:34:59 -0400 Tristan Van Berkom [EMAIL PROTECTED] wrote: img_item = gnome_canvas_item_new(root, gnome_canvas_pixbuf_get_type(), pixbuf, pxb, x, 0.0, y, 0.0, width, pxb_w, height, pxb_h,