[Urwid] mouse_event to keypress
meneldor at gmail.com
Fri Feb 15 12:02:00 EST 2013
Thanks Ian, i will test it. But i am not sure what will happen to the
scroll i already made with the Text lines. If i return True from inside any
mouse_event method does unhandled_input in MainLoop catch it?
On Fri, Feb 15, 2013 at 6:56 PM, Ian Ward <ian at excess.org> wrote:
> On Fri, Feb 15, 2013 at 11:52 AM, Angel Kolev <meneldor at gmail.com> wrote:
> > It would be very hard to post the whole code because its separated in
> > files/libs.
> > I created a plugin-based framework and made it to open unlimited
> pop-ups. I
> > made a main class Window which is responsible for all widgets in it.
> > has a method add_row() so i am building whatever mixed widget i want.
> > Example code for the menu from above:
> > window = self.new_window(21, 55, text="Choose User and Pass
> > each host (%s)" % len(hosts))
> > for item in hosts:
> > window.add_row([ BaseInput(' User: ',value=item),
> > BaseInput(' Pass: ',value=item) ],border=item)
> > window.add_buttons([ "Done"])
> > return window
> > The result from the code above is in the attached screenshot.
> > So, i want to use the mouse scroll to scroll the rows instead of the
> > keyboard, but i cant convert the mouse_event to keypress up/down.
> I see.
> Maybe you want to convert all unhandled mouse wheel events into
> up/down keystrokes? That can be done in an unhandled_input callback
> on your MainLoop that checks for the mouse event and calls
> main_loop.process_input(['up']) or ...(['down'])
> Urwid mailing list
> Urwid at lists.excess.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Urwid