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

Windows ScrollContainer not responding to changes in inner content #1915

Closed
freakboy3742 opened this issue Apr 30, 2023 Discussed in #1912 · 2 comments · Fixed by #1969
Closed

Windows ScrollContainer not responding to changes in inner content #1915

freakboy3742 opened this issue Apr 30, 2023 Discussed in #1912 · 2 comments · Fixed by #1969
Labels
bug A crash or error in behavior. windows The issue relates to Microsoft Windows support.

Comments

@freakboy3742
Copy link
Member

freakboy3742 commented Apr 30, 2023

Discussed in #1912

Originally posted by YTLoudYN April 29, 2023

TEST.mp4
import toga
from toga.constants import COLUMN, ROW, RED
from toga.style import Pack

class TEST(toga.App):
    TOGGLE_CHUNK = 10

    vscrolling = True
    hscrolling = False
    scroller = None

    def startup(self):

        self.main_box = toga.Box(style=Pack(direction=COLUMN))

        self.box = toga.Box()
        self.box.style.direction = COLUMN
        self.box.style.padding = 10
        self.scroller = toga.ScrollContainer(
            horizontal=self.hscrolling, vertical=self.vscrolling
        )

        self.box2 = toga.Box()
        self.box2.add(
            toga.Label('Thie is a TEST( Print 0 ~ 100 )'),
            toga.Button('START',on_press=self.start_on)
        )
        self.box.add(self.box2)

        self.scroller.content = self.box

        self.main_window = toga.MainWindow(title=self.formal_name)
        self.main_window.content = self.scroller
        self.main_window.show()

    def start_on(self,args):

        self.box.remove(self.box2)

        self.box2 = toga.Box(style=Pack(direction=COLUMN))

        for i in range(100):
            self.box2.add(
                toga.Label('>>>' + str(i))
            )

        self.box.add(
            toga.Label('Print 0 ~ 100', style=Pack(color=RED)),
            self.box2
        )
        self.main_window.show()

def main():
    return TEST('TEST','id')

if __name__ == '__main__':
    main().main_loop()
@freakboy3742 freakboy3742 added bug A crash or error in behavior. windows The issue relates to Microsoft Windows support. labels Apr 30, 2023
@YTLoudYN
Copy link

YTLoudYN commented Apr 30, 2023

It's not about not responding to changes in content

This is a static example with the same problem:

235331233-77908ebb-62d2-43c2-99ad-b9128c845a35.mp4

toga/examples/scrollcontainer/scrollcontainer/app.py

The code url:
https://github.com/beeware/toga/blob/main/examples/scrollcontainer/scrollcontainer/app.py

@freakboy3742
Copy link
Member Author

I suspect this is the same issue as #1983; regardless, it should be fixed by #1969.

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.

2 participants