[Urwid] mouse_event to keypress

Ian Ward ian at excess.org
Fri Feb 15 11:35:49 EST 2013


On Fri, Feb 15, 2013 at 11:25 AM, Angel Kolev <meneldor at gmail.com> wrote:
> Well, the problem is that i cant be sure in what container the BaseInput
> will be placed. I tried to call the keypress method of ListBox which is on
> top of the BaseInput using:
>  some_list_box_object.keypress(size,"down")
> but it threw an error about sizing.
> It made something similar for Text widgets stored in ListBox:
>>
>>         if button == 5:
>>             if len(self.body)-1 > self.focus_position:
>>                 self.set_focus(self.focus_position+1, coming_from="above")
>>         elif button == 4 :
>>             if self.focus_position > 0:
>>                 self.set_focus(self.focus_position-1, coming_from="below")
>
>
> So it scrolls trough a list of Text lines perfectly but i cant do it with
> Edit's

Would you post a complete runnable example of what you're trying to do?



More information about the Urwid mailing list