help hooks



Hi,

It appears that GtkColorSelectionDialog has a Help button that doesn't
do anything. Obviously this will result in tons of apps with a Help
button that doesn't do anything, since people won't connect it. ;-)

My initial plan was to just remove the help button. Owen pointed out
that this leads to a gratuitous GnomeColorSelectionDialog that just
adds a help button.

So, we came up with the following alternative proposal (functions not
namespaced Tim, come up with a namespace - I hate to use gtk_help_ for
this, we might have a future more extensive facility using that one).

 void
 gtk_set_help_for_type (GType     widget_type_id,
                        GClosure *closure);   

 gboolean
 gtk_have_help_for_type (GType type_id);

 void 
 gtk_invoke_help_for_type (GType type_id);

The intended usage is that gnome_init() or the user app calls:

  gtk_set_help_for_type (GTK_TYPE_COLOR_SELECTION_DIALOG,
                         closure_that_displays_help);

the color selection displays a help button if gtk_have_help_for_type()
returns TRUE, and otherwise there's no help button. The help button
calls gtk_invoke_help_for_type().

We then add a help button to all the standard dialogs, including file
selection, font selection, etc.

This interface doesn't map directly to language bindings in any good
way, so you'd have to make up a language-appropriate alternative; in
C++, for example, you might have:

 class ColorSelectionDialog
 { 
   static void set_help (Slot *slot);
 };

Havoc








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