aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2003-07-16 20:16:56 +0000
committerEric S. Raymond <esr@thyrsus.com>2003-07-16 20:16:56 +0000
commit8d5722cff4f25a4ecc4f2b40664e6e3667df8747 (patch)
treef519bfa7bd55bdc4e5f6556db3a43c30c7282d1c
parent9fa54460136c706f334a67d4d442ac9dc3bb20fb (diff)
downloadfetchmail-8d5722cff4f25a4ecc4f2b40664e6e3667df8747.tar.gz
fetchmail-8d5722cff4f25a4ecc4f2b40664e6e3667df8747.tar.bz2
fetchmail-8d5722cff4f25a4ecc4f2b40664e6e3667df8747.zip
Use clicked signal to intercept button presses.
svn path=/trunk/; revision=3810
-rwxr-xr-xtorturetest.py26
1 files changed, 11 insertions, 15 deletions
diff --git a/torturetest.py b/torturetest.py
index e549c25d..fd5d7c37 100755
--- a/torturetest.py
+++ b/torturetest.py
@@ -108,17 +108,20 @@ class TortureGUI:
def __init__(self):
# Build the widget tree from the glade XML file.
self.wtree = gtk.glade.XML("torturetest.glade")
+ # File in initial values
self.combo = self.wtree.get_widget("combo1")
- self.site = sitelist[0]
-
self.combo.set_popdown_strings(map(lambda x: x.comment, sitelist))
+ self.site = sitelist[0]
self.display(self.site)
# Provide handlers for the widget tree's events
- dict = {}
- for key in dir(self.__class__):
- dict[key] = getattr(self, key)
- self.wtree.signal_autoconnect(dict)
+ mydict = {}
+ for key in ('on_torturetest_destroy',
+ 'on_quitbutton_clicked',
+ 'on_savebutton_clicked',
+ 'on_combo_entry1_activate'):
+ mydict[key] = getattr(self, key)
+ self.wtree.signal_autoconnect(mydict)
gtk.mainloop()
print `self.site`
@@ -155,25 +158,18 @@ class TortureGUI:
# Housekeeping
def on_torturetest_destroy(self, obj):
gtk.mainquit()
- print "Destroy"
- def on_quitbutton_activate(self, obj):
- gtk.mainquit()
- print "Mainquit"
- def on_savebutton_activate(self, obj):
+ def on_quitbutton_clicked(self, obj):
gtk.mainquit()
+ def on_savebutton_clicked(self, obj):
print "Save"
def on_deletebutton_activate(self, obj):
- gtk.mainquit()
print "Delete"
- gtk.mainquit()
def on_new1_activate(self, obj):
- gtk.mainquit()
print "New"
def on_open1_activate(self, obj):
print "Open"
def on_combo_entry1_activate(self, obj):
- print "I see you!"
key = self.combo.entry.get_text()
for site in sitelist:
if site.comment.find(key) > -1: