Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic changes to ScrollContainer content not applying #1655

Closed
freakboy3742 opened this issue Nov 5, 2022 · 1 comment · Fixed by #1969
Closed

Dynamic changes to ScrollContainer content not applying #1655

freakboy3742 opened this issue Nov 5, 2022 · 1 comment · Fixed by #1969
Labels
bug A crash or error in behavior. windows The issue relates to Microsoft Windows support.

Comments

@freakboy3742
Copy link
Member

There is currently a bug with the toga.Scroll_container() widget where if you try to change the content of it, the app displays everything weird.

To Reproduce
Steps to reproduce the behavior:

  1. Create a scroll container widget and set it as the content of the main window.
#create a box and add any widgets needed
my_box=toga.Box(style=Pack(direction=COLUMN, padding=5))
my_box.add(widget)
self.scroll_container = toga.Scroll_container(vertical=True, horizontal=False, content=my_box)
self.main_window.content=self.scroll_container

Then in a handler for a button that changes the content of the scroll container:

def change_content(self, widget):
  self.scroll_container.content=another_box

Whatever is in the second box will try to display, but all of the content from the first box will still be there.

Expected behavior

Content from the second content box should be added to the scroll container; original content should be replaced.

Environment:

  • Operating System: Windows
  • Python version: ?
  • Software versions:
    • Briefcase: ?
    • Toga: ?
    • ...

Additional context

Reported via Discord user @blindgoofball

@freakboy3742 freakboy3742 added bug A crash or error in behavior. up-for-grabs windows The issue relates to Microsoft Windows support. labels Nov 5, 2022
@freakboy3742
Copy link
Member Author

See #1915 for a possibly related bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A crash or error in behavior. windows The issue relates to Microsoft Windows support.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant