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

Winforms ScrollContainer not displaying all content, or responding to new content #1983

Closed
freakboy3742 opened this issue Jun 14, 2023 Discussed in #1966 · 0 comments · Fixed by #1969
Closed

Winforms ScrollContainer not displaying all content, or responding to new content #1983

freakboy3742 opened this issue Jun 14, 2023 Discussed in #1966 · 0 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

Reported in #1966.

Sample project:

import toga
from toga.style.pack import Pack, COLUMN


class Quantity(toga.App):
    def startup(self):
        self.count = 1
        self.box = toga.Box(style=Pack(direction=COLUMN))
        main_box = toga.Box(style=Pack(direction=COLUMN))
        for n in range(0, 100):
            label = toga.Label(f"label {n}")
            self.box.add(label)
        main_scroll = toga.ScrollContainer(style=Pack(flex=1))
        main_scroll.content = self.box
        addWidgetsBut = toga.Button("Add Label", on_press=self.butEvent)
        main_box.add(main_scroll)
        main_box.add(addWidgetsBut)
        self.main_window = toga.MainWindow(title=self.formal_name)
        self.main_window.content = main_box
        self.main_window.show()

    def butEvent(self, widget):
        print(f"New label {self.count}")
        label = toga.Label(f"New label {self.count}")
        self.box.add(label)
        self.count += 1


def main():
    return Quantity("App", "org.beeware").main_loop()


main()

On GTK and Cocoa (as of #1969), this app works as expected - all 99 lines of initial content are vertically scrollable, and if new content is added, the new line is appended.

On Winforms (using mainline), only the first ~30 lines of content are displayed, and adding new content seems to remove the vertical scroll entirely.

@freakboy3742 freakboy3742 added the windows The issue relates to Microsoft Windows support. label Jun 14, 2023
@freakboy3742 freakboy3742 added the bug A crash or error in behavior. label Jun 14, 2023
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