It would be very hard to post the whole code because its separated in many
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. Window
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 for
each host (%s)" % len(hosts))
for item in hosts:
window.add_row([ BaseInput(' User: ',value=item[1][0]),
BaseInput(' Pass: ',value=item[1][1]) ],border=item[0])
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.On Fri, Feb 15, 2013 at 6:35 PM, Ian Ward <[email protected]> wrote: > On Fri, Feb 15, 2013 at 11:25 AM, Angel Kolev <[email protected]> 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? > > _______________________________________________ > Urwid mailing list > [email protected] > http://lists.excess.org/mailman/listinfo/urwid >
<<attachment: widget.png>>
_______________________________________________ Urwid mailing list [email protected] http://lists.excess.org/mailman/listinfo/urwid
