How can I check if a GtkWidget exists?

2012-07-20 Thread Frank Cox
How can I check if a GtkWidget exists? I am planning to create and destroy widgets in a window depending on the user's selections, but I can't figure out how to determine if a particular widget already exists in the window so it won't be created twice or receive a second deletion attempt if it's

Re: How can I check if a GtkWidget exists?

2012-07-20 Thread David Nečas
On Fri, Jul 20, 2012 at 12:50:45AM -0600, Frank Cox wrote: How can I check if a GtkWidget exists? By keeping track of it (either when you create and destroy the widgets or using weak references/weak pointers/destroy callbacks/...). ‘Checking the existence of a widget’ is, essentially

Re: How can I check if a GtkWidget exists?

2012-07-20 Thread Miroslav Rajcic
On 7/20/2012 8:50 AM, Frank Cox wrote: How can I check if a GtkWidget exists? I am planning to create and destroy widgets in a window depending on the user's selections, but I can't figure out how to determine if a particular widget already exists in the window so it won't be created twice

Re: How can I check if a GtkWidget exists?

2012-07-20 Thread David Nečas
On Fri, Jul 20, 2012 at 10:15:54AM +0200, Miroslav Rajcic wrote: Not sure, but perhaps GTK_IS_WIDGET(widget) macro would help. If you have the pointer to a GObject instance and want to know whether it is an instance of GtkWidget (including subclasses) then GTK_IS_WIDGET() is the right thing to

Re : How can I check if a GtkWidget exists?

2012-07-20 Thread Nicolas SOUBEIRAN
Have you try g_object_add_weak_ref ? Weak references are used for notification when an object is finalized. Hope this helps. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Re : How can I check if a GtkWidget exists?

2012-07-20 Thread Kevin DeKorte
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 07/20/2012 11:54 AM, Nicolas SOUBEIRAN wrote: Have you try g_object_add_weak_ref ? Weak references are used for notification when an object is finalized. Hope this helps. The GTK_IS_WIDGET macro is useful as well. Kevin - -- Get my public