[maemo-developers] hildon.StackableWindow and blocking windows
From: Max Usachev maxusachev at gmail.comDate: Wed Feb 16 11:01:04 EET 2011
- Previous message: Nokia and MS
- Next message: hildon.StackableWindow and blocking windows
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi!
I want to use StackableWindow in my program like dialogs, but dialogs is not
suitable for me, because I want to have different application menus in every
dialog, so, I decided to use StackableWindow. But the problem is that
showing new window (creating it and putting on the top of the stack) doesn't
blocks the code, which call window creation. Is it possible to use
StackableWindow alike dialogs concept?
There is small example: (now I see print 'after destroying window' after
showing new window, that is wrong. It should be showed after window
destroying).
import gtk
import hildon
class BlockedWindow:
def __init__(self, parent):
win = hildon.StackableWindow()
win.set_title('Modal window')
win.set_modal(True)
win.set_transient_for(parent)
label = gtk.Label("This is a subview")
vbox = gtk.VBox()
vbox.pack_start(label)
win.add(vbox)
self.win = win
def activate(self):
self.win.show_all()
def show_new_window(widget, parent):
print 'before showing blocked window'
win = BlockedWindow(parent)
win.activate() # like dialog.run()
print 'after destroying window'
def main():
program = hildon.Program.get_instance()
win = hildon.StackableWindow()
win.set_title("Main window")
button = gtk.Button("Go to subview")
win.add(button)
button.connect("clicked", show_new_window, win)
win.connect("destroy", gtk.main_quit, None)
win.show_all()
gtk.main()
if __name__ == "__main__":
main()
Br, Max.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.maemo.org/pipermail/maemo-developers/attachments/20110216/8247e91f/attachment.htm>
- Previous message: Nokia and MS
- Next message: hildon.StackableWindow and blocking windows
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
