Christopher Trudeau
2013-01-13 15:15:35 UTC
I apologize if this shows up twice, I didn't originally send it from the
account I signed up with and I think the list manager ignored it.
----------
I'm trying to add a "help" dialog box to my application so have been
fiddling with Overlay and PopUpLauncher, with little success with either.
With Overlay I've yet to be able to see an overlayed window, no exceptions,
just does nothing. With PopUpLauncher I've had similar problems, in
certain configurations I've managed to see a window but not been able to
get it to focus. I've looked at the examples, but they all seem to be
based on a simple underlying window with only a button, as soon as I try to
do something more complicated I get stuck.
Below is a simple version of what I'm trying to accomplish that is
structured in a similar vein to the larger program. Any hints on what I'm
doing wrong would be greatly appreciated. This version shows nothing at
all, debug statements confirm things are getting run and constructed (not
shown below) but nothing is shown.
def key_handler(key):
if key in ('q', 'Q'):
raise urwid.ExitMainLoop()
elif key in ('o', 'O'):
show_overlay();
def show_overlay():
text = urwid.Text(POPUP_TEXT)
pile = urwid.Pile([text, ])
urwid.Overlay(pile, outer, 'center', 50, 'middle', 50)
header = urwid.Text(('header', 'q=quit; o=overlay'))
roach = urwid.Text(ROACH)
fill = urwid.Filler(roach, 'top')
outer = urwid.Frame(fill, header=header)
loop = urwid.MainLoop(outer, palette,
unhandled_input=key_handler, pop_ups=True)
loop.run()
Thanks for your help.
account I signed up with and I think the list manager ignored it.
----------
I'm trying to add a "help" dialog box to my application so have been
fiddling with Overlay and PopUpLauncher, with little success with either.
With Overlay I've yet to be able to see an overlayed window, no exceptions,
just does nothing. With PopUpLauncher I've had similar problems, in
certain configurations I've managed to see a window but not been able to
get it to focus. I've looked at the examples, but they all seem to be
based on a simple underlying window with only a button, as soon as I try to
do something more complicated I get stuck.
Below is a simple version of what I'm trying to accomplish that is
structured in a similar vein to the larger program. Any hints on what I'm
doing wrong would be greatly appreciated. This version shows nothing at
all, debug statements confirm things are getting run and constructed (not
shown below) but nothing is shown.
def key_handler(key):
if key in ('q', 'Q'):
raise urwid.ExitMainLoop()
elif key in ('o', 'O'):
show_overlay();
def show_overlay():
text = urwid.Text(POPUP_TEXT)
pile = urwid.Pile([text, ])
urwid.Overlay(pile, outer, 'center', 50, 'middle', 50)
header = urwid.Text(('header', 'q=quit; o=overlay'))
roach = urwid.Text(ROACH)
fill = urwid.Filler(roach, 'top')
outer = urwid.Frame(fill, header=header)
loop = urwid.MainLoop(outer, palette,
unhandled_input=key_handler, pop_ups=True)
loop.run()
Thanks for your help.
--
Christopher Trudeau
ctrudeau at arSensa.com
(cell) 416-731-4304
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.excess.org/pipermail/urwid/attachments/20130113/cb6f2843/attachment.htm
Christopher Trudeau
ctrudeau at arSensa.com
(cell) 416-731-4304
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.excess.org/pipermail/urwid/attachments/20130113/cb6f2843/attachment.htm