[maemo-developers] show existing StackableWindow second time
From: Max Usachev maxusachev at gmail.comDate: Tue Feb 16 14:18:26 EET 2010
- Previous message: show existing StackableWindow second time
- Next message: rpm vs. deb and "universal binaries/packages"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 16.02.2010 13:09, Martin Grimme wrote: > You need to connect to the delete-event of the subwindow and invoke > hide() in there to hide the window. Your delete callback must return > True to signalize that the windows is not to be destroyed. > > > Martin > > Thank you! This chunk of code works: ... self.window.connect("delete-event", self.hide_subwindow_cb) .... def hide_subwindow_cb(self, widget, event): # redefine 'delete-event'. # Hide window instead of it destroying widget.emit_stop_by_name('delete-event') widget.hide() return True > 2010/2/16, Max Usachev<maxusachev at gmail.com>: > >> Hello! >> Please, help me with hiding stackable window. >> My app has Main mode and submodes. >> Each submode = class instance + its UI. Each mode has Activate method: >> if class instance is exists, then activate method must only show mode >> UI, else, if there is no instance, method must create class instance and >> its UI and show this UI. This is my code, and I can't show UI of >> existing mode second time: >> >> import gtk >> import hildon >> >> class SubMode: >> def __init__(self): >> self.window = None >> >> def activate(self): >> if not self.window: >> self.window = hildon.StackableWindow() >> self.window.set_title("SubMode") >> self.window.show_all() >> >> class TestApp(): >> def __init__(self): >> self.window = None >> self.submode_object = None >> self.create_ui() >> >> def create_ui(self): >> """Create Main mode UI.""" >> self.window = hildon.StackableWindow() >> self.window.set_title('Main mode') >> self.window.connect('destroy', gtk.main_quit) >> vbox = gtk.VBox() >> button = hildon.Button(gtk.HILDON_SIZE_AUTO, \ >> hildon.BUTTON_ARRANGEMENT_VERTICAL) >> button.set_title("Activate SubMode") >> button.connect('clicked', self.activate_submode) >> vbox.pack_start(button) >> self.window.add(vbox) >> self.window.show_all() >> >> def activate_submode(self, widget): >> """Show submode.""" >> if not self.submode_object: >> self.submode_object = SubMode() >> self.submode_object.activate() >> >> >> if __name__ == "__main__": >> TestApp() >> gtk.main() >> >> >> >> Br, >> Max Usachev. >> _______________________________________________ >> maemo-developers mailing list >> maemo-developers at maemo.org >> https://lists.maemo.org/mailman/listinfo/maemo-developers >> >> >
- Previous message: show existing StackableWindow second time
- Next message: rpm vs. deb and "universal binaries/packages"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]