i'm currently trying to build a little ui for can bus testing on a raspberry pi. it's basically very easy built since it only has a main info screen and an input text. My problem is that i cannot find how to make that input text scroll automatically to the last text sent..
this is how my tiny ui is created..
# create ui
self.edit= urwid.Edit(caption="Input: ", edit_text='')
header = urwid.AttrWrap(urwid.Text('Barobo CAN Control Center (type \'help\' for help, F8 or \'quit\' for exit)'), 'header')
footer = urwid.AttrWrap(urwid.AttrWrap(self.edit,'editbx'), 'footer')
self.txt= urwid.Text("")
listbox_content = [self.txt,valign='bottom']
listbox = urwid.ListBox(urwid.SimpleListWalker(listbox_content))
self.frame = urwid.Frame(urwid.AttrWrap(listbox, 'body'), header=header, footer=footer, focus_part='footer')
so what i need now is something that makes self.txt the last text drawn there.. or even make it scrollable with page up and page down keys..
any hints there? Edit: I've learned that i have to append text as widgets to the listwalker. Before I just added text to the only text widget in my listbox
def log(self, message, level='info'):
'''
append a message to the message window
'''
if self.__loglevel >= LogDisplay.level.index(level):
txt = urwid.Text(message)
self.__walker.append(txt)
but it still doesn't show the last items..
Can you use Tkinter then it would simple as