proposed "transient setup" API




Hi,

Proposal for gnome-libs 2.0:

typedef void (* GnomeTransientSetupFunc) (GtkWindow* window, gpointer user_data);

void
gnome_set_transient_setup_handler(GnomeTransientSetupFunc func,
                                  gpointer data);

/* (Also need to have _full variant, or use new GSlot/GClosure thingy from 
    GTK 1.4) */

void
gnome_setup_transient(GtkWindow* transient)
{
   /* will use a marshaller etc. in real life */
   if (transient_setup_handler)
     (* transient_setup_handler)(transient, data);
}

The basic idea here is that gnome_setup_transient() sets up a dialog,
potentially setting the transient parent, the class name hints, or
whatever else the application author wants.

The advantage to putting it in gnome-libs (besides convenience) is
that gnome-libs itself can pop up error dialogs or whatever, and have
them handled properly. As it is, if the library has an error dialog it
can't properly set the hints on it.

Comments?

Havoc



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