3
# A very simple program that monitors a single key for changes.
9
def key_changed_callback (client, cnxn_id, entry, label):
13
if entry.value.type == gconf.VALUE_STRING:
14
label.set_text (entry.value.to_string ())
16
label.set ('<wrong type>')
18
client = gconf.client_get_default ()
20
window = gtk.Window ()
21
window.set_default_size (120, 80)
22
window.connect ('destroy', lambda w: gtk.mainquit ())
24
s = client.get_string ("/testing/directory/key")
26
label = gtk.Label (s or '<unset>')
29
client.add_dir ('/testing/directory',
30
gconf.CLIENT_PRELOAD_NONE)
32
client.notify_add ("/testing/directory/key",
33
key_changed_callback, label)