diff options
author | erick <erick@sugar-dev-erick.(none)> | 2009-12-05 00:19:19 (GMT) |
---|---|---|
committer | erick <erick@sugar-dev-erick.(none)> | 2009-12-05 00:19:19 (GMT) |
commit | dbf88e0f12fe015467ecf89d95a2ba4303d9f73a (patch) | |
tree | 875d5a0f321128db76de01faca006af84b72cbd4 /Workshop.activity/TutorialStoreSearch.py | |
parent | cda15f1fffcca24286867a9064d30dec662e796b (diff) | |
parent | 9a44da4488a0ff00150eb5cb114f74ba560b96a6 (diff) |
Merge branch 'master' into frame_integration
Diffstat (limited to 'Workshop.activity/TutorialStoreSearch.py')
-rw-r--r-- | Workshop.activity/TutorialStoreSearch.py | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Workshop.activity/TutorialStoreSearch.py b/Workshop.activity/TutorialStoreSearch.py new file mode 100644 index 0000000..4303a07 --- /dev/null +++ b/Workshop.activity/TutorialStoreSearch.py @@ -0,0 +1,38 @@ +import sys, os +import gtk + +class TutorialStoreSearch(gtk.HBox): + + def __init__(self,controller): + gtk.HBox.__init__(self,False, 5) + self.controller = controller + search_label = gtk.Label('Search :') + self.search_box = gtk.Entry(400) + in_label = gtk.Label('in') + self.search_combobox = gtk.combo_box_new_text() + self.search_button = gtk.Button('Search') + + self.pack_start(search_label, True, True, 5) + self.pack_start(self.search_box, True, True, 5) + self.pack_start(in_label, True, True, 5) + self.pack_start(self.search_combobox, True, True, 5) + self.pack_start(self.search_button, True, True, 5) + + search_label.show() + self.search_box.show() + in_label.show() + self.search_combobox.show() + self.search_button.show() + + self.search_button.connect("clicked",self.controller.search_store,{'keyword':self.search_box, + 'category':self.search_combobox}) + + def set_categories(self,categories): + self.search_combobox.set_active(0) + while self.search_combobox.get_active_text() is not None: + self.search_combobox.remove_text(0) + self.search_combobox.set_active(0) + + for category in categories: + self.search_combobox.append_text(category) +
\ No newline at end of file |