0

I am using guizero to create a simple UI on a Python script on a Raspberry Pi 3. It is working though i'm having issues with the TextBox append() method.

The sample code illustrates the problem. It creates a 3 line TextBox with a scrollbar, however, when i use the append() method to add new lines i must scroll to see them.

How do i get the TextBox to automatically scroll to the bottom to show the last written text?

Help!

from guizero import App, TextBox, PushButton

def append():
    txtboxTest.append('Appended Text Not Visible Without Scrolling')

app = App(title="Test")
txtboxTest = TextBox(app, width=300, height=3, multiline=True, scrollbar=True, text="1\n2\n3")
appendbutton = PushButton(app, command=append, text="Append")

app.display()
3
  • I need somebody... Help! Not just anybody... Oh, sorry. Your phrasing made me think of that song. ;)
    – moltarze
    Dec 23, 2018 at 0:35
  • Looks like txtboxTest.tk.see('end') after each append might work - don't have guizero installed to test this. Dec 23, 2018 at 0:41
  • @jasonharper Thankyou that worked! Can you answer so i can accept?
    – Kevin
    Dec 23, 2018 at 0:49

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.