Re: [gtk-list]



On 1 May 1998 list@mail2.redhat.com wrote:

> i have a(nother) problem that's driving me nuts. the following fragment of 
> code is mostly taken from testgtk.c and the tutorial, but it still doesn't 
> work and i have no idea *why* :
> 
> 
> 
> static void file_open (GtkWidget *widget, gpointer data)
> {
>   static GtkWidget *window = NULL;
> 
>   if (!window)
>     {
>       window = gtk_file_selection_new ("Open file...");
>       gtk_signal_connect (GTK_OBJECT (window), "destroy",
>                           GTK_SIGNAL_FUNC (destroy_window),
					     ^^^^^^^^^^^^^^
					     use gtk_widget_destroyed here
>                           &window);
>       gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION(window)->ok_button), 
>                           "clicked", (GtkSignalFunc) file_open_ok, window);
>       gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION(window)-
        ^^^^^^^^^^^^^^^^^^
        make this gtk_signal_connect_object

> >cancel_button), 
>                           "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), 
>                           GTK_OBJECT(window));
> 
>     }
> 
>   if (!GTK_WIDGET_VISIBLE (window))
>     gtk_widget_show (window);
>   else
>     gtk_widget_destroy (window);
> }

---
ciaoTJ



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]