| Server IP : 182.53.201.61 / Your IP : 216.73.217.175 Web Server : Apache/2.2.15 (Fedora) System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686 User : apache ( 48) PHP Version : 5.3.3 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/doc/gnome-python2-gconf-2.28.0/ |
Upload File : |
#!/usr/bin/env python
#
# A very simple program that monitors a single key for changes.
#
import gtk
import gconf
def key_changed_callback (client, cnxn_id, entry, label):
if not entry.value:
label.set ('<unset>')
else:
if entry.value.type == gconf.VALUE_STRING:
label.set_text (entry.value.to_string ())
else:
label.set ('<wrong type>')
client = gconf.client_get_default ()
window = gtk.Window ()
window.set_default_size (120, 80)
window.connect ('destroy', lambda w: gtk.main_quit ())
s = client.get_string ("/testing/directory/key")
label = gtk.Label (s or '<unset>')
window.add (label)
client.add_dir ('/testing/directory',
gconf.CLIENT_PRELOAD_NONE)
client.notify_add ("/testing/directory/key",
key_changed_callback, label)
window.show_all ()
gtk.main ()