Re: [gtk-list] Re: A quicky (window manager related)



On Thu, 16 Oct 1997, Raph Levien wrote:

> 
> 
> On Thu, 16 Oct 1997, Leon Gierat wrote:
> 
> > 
> > I'm running window maker 0.6.3, and I've got gtk release 970925, and I
> > can't seem to get windows to die using the window manager. I'm using the
> > window manager "destroy" signal to trigger off either a gtk_widget_destroy
> > on the main window and/or gtk_main_quit (it all depends, I've tried many 
> > but probably missed the one combination that works).

[snip]

> Yep. This should have found its way into my gtk nits post a few days ago too.

It is a little odd for the default behaviour, but once you know about it,
it's not so bad.

> In the meantime, add this code for all windows created:
> 
> /* A signal handler for the window manager delete signal. Returns true
>    so that the window gets destroyed. */
> static gboolean
> handle_delete (GtkWidget *widget, void *dummy)
> {
>   return TRUE;
> }
> 
> gtk_signal_connect (GTK_OBJECT (window), GTK_SIGNAL_FUNC (handle_delete), 
> NULL);

Woops, forgot a part - lemme just fix it for ya :)

gtk_signal_connect(GTK_OBJECT(window), "delete_event",
                   GTK_SIGNAL_FUNC(handle_delete), NULL);

You have to connect the "delete_event".


Ian



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