Class BasicGConfApp
In: gconf/sample/basic-gconf-app.rb
Parent: Object

Special mention of an idiom often used in GTK+ apps that does not work right with GConf but may appear to at first:

 i_am_changing_value = TRUE;
 change_value (value);
 i_am_changing_value = FALSE;

This breaks for several reasons: notification of changes may be asynchronous, you may get notifications that are not caused by change_value () while change_value () is running, since GConf will enter the main loop, and also if you need this code to work you are probably going to have issues when someone other than yourself sets the value.

A robust solution in this case is often to compare the old and new values to see if they‘ve really changed, thus avoiding whatever loop you were trying to avoid.

Methods

Public Class methods

The keys we‘re going to play with

Public Instance methods

Create an entry used to edit the given config key

Create a Gtk::Label inside a frame, that we can "configure" (the label displays the value of the config key).

[Validate]