|
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.52">
GnomePropertyBoxSynopsis
Object Hierarchy
DescriptionThe GnomePropertyBox widget simplifies coding a consistent dialog box for configuring properties of any kind. The GnomePropertyBox is a toplevel widget (it will create its own window), inside it contains a GtkNotebook which is used to hold the various property pages. The box will include ok, cancel, apply and help buttons (the actual buttons depends on the settings the user has, for example, apply can be hidden). The ok and apply buttons will start up in non-sensitive state, the programmer needs to configure the widgets inserted into the property box to inform the widget of any state changes to enable the ok and apply buttons. This is done by calling the gnome_property_box_changed() function. To use this widget, you create the widget using gnome_property_box_new() and then you call gnome_property_box_append_page() for each property page you want in the property box. The widget emits two signals: "apply" and "help". To make a functional dialog box you will want to connect to at least the "apply" signal. Your function will be invoked once for each page and one more time at the end, passing a special value of -1 for the page number. Here is a sample callback routine layout Example 1. Sample callback for the "apply" signal
Some people just check for the last condition like this: Example 2. Sample callback for the "apply" signal
A fully finished program should also hook up to the "help" signal to provide context sensitive help in the dialog box. This signal also receives the page number in which the help is invoked, so you can provide different help nodes for each page if you desire to do so. The GNOME libraries include a number of helper routines that will help you provide help in your application. Here is a sample piece of code: Example 3. Sample callback for the "help" signal
You can actually save some time if you use the
Example 4. Connecting the "help" signal using the
See the documentation for Detailsgnome_property_box_new ()
Creates a new GnomePropertyBox widget. The PropertyBox widget is useful for making consistent configuration dialog boxes. When a setting has been made to a property in the PropertyBox your program needs to invoke the gnome_property_box_changed to signal a change (this will enable the Ok/Apply buttons).
gnome_property_box_changed ()
When a setting has changed, the code needs to invoke this routine to make the Ok/Apply buttons sensitive.
gnome_property_box_set_state ()
gnome_property_box_append_page ()
Appends a new page to the GnomePropertyBox.
|