Auto quit

I am not sure if this is a good idea, but I thought I would at
least ask.  I am thinking of adding an automatic call to
gtk_mai_quit when the last window is shutdown, if there is not
such a mechanism already.

The API would be like

/* enables/disables automatic shutdown when last toplevel widget dies */
void gtk_set_auto_quit(gboolean);

/* sends delete_event to all windows, (nicer than quit as they have option
  of not quitting. */
void gtk_delete_all();

/* indicates there is some additional resource other than toplevel window
needed to prevent quit*/
void gtk_auto_quit_ref();

/* additional resource finished with */
void gtk_auto_quit_unref();

(Anyone got better names?)

It would be a hack in gtk_container_unregister_toplevel such
that when the toplevel list is empty and no other resource quit gets 
called.  I also think the gtk_container_* toplevel handling belongs down
at GtkWidget level or up at GtkWindow level in gtk+ 1.4.  Placing
it at container level seems off.

Anyone what to tell me I am smoking crack and we already have this
functionality?  (If so please point me to it. :-)  


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