Re: Is this OK?
- From: Jeffrey Goddard <moosewood mooseroot org>
- To: tpm01 aber ac uk
- Cc: Gtk Developement List <gtk-app-devel-list gnome org>
- Subject: Re: Is this OK?
- Date: Wed, 31 Jul 2002 21:18:22 -0500
On Wednesday 31 July 2002 19:43, TP Muller wrote:
On Thursday 01 August 2002 01:08, vladimir wrote:
void kstudentnew_quit_cb (GtkWidget *widget, gpointer callback_data)
gtk_widget_destroy ((GtkWidget *)callback_data);/* destroy main
Can I cast callback_data like this? Main window is not main for app, but
for entry dialog for some data. When user cancel this window it calls
this callback. Is there cleaner way, or can go with this one?
You can do it like this, although it would probably be better to use the
predefined macros, which also have the advantage that they check whether
the pointer cast really points to a structure of the appropriate type
(which is invaluable when you try to find a bug where the pointer contains
the question that pops into my mind is - are you really done with the widget?
if not, you will probably have to recreate it if the user wants to enter more
data. if you use gtk_widget_hide(...) instead, you can always do
gtk_widget_show(...) to enter more data.
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
] [Thread Prev