Skip to content

Comments

add sensitive scrollbar feature#2539

Open
HelloWorld-er wants to merge 7 commits intoTomSchimansky:masterfrom
HelloWorld-er:sensitive_scrollable_frame_features
Open

add sensitive scrollbar feature#2539
HelloWorld-er wants to merge 7 commits intoTomSchimansky:masterfrom
HelloWorld-er:sensitive_scrollable_frame_features

Conversation

@HelloWorld-er
Copy link

Originally, scrollbar in scrollable frame is displayed regardless whether it is necessary. If the content size is smaller than the frame size, the scrollbar of that scrollable frame is not necessary to be displayed. I added a few lines of code to check whether it is necessary to display scrollbar in that frame as event is happened.

@HelloWorld-er
Copy link
Author

Because I have accidentally deleted the file, I reset it. And also, because of previous misunderstanding, the scrollbar will not be sensitive and the frame may also collapse if the size of the frame is set under a certain value. Now I have updated. So if you want to see the difference, go straight to the last update which should be under this comment.

@FedericoSpada
Copy link
Collaborator

Hi,
If I run a function like this to add new widgets to the frame,

def callback(self) -> None:
    for i in range(3):
        switch = CTkSwitch(self.scrollable_frame, text=f"CTkSwitch {i+1}")
        switch.pack(padx=20, pady=5)
    self.after(3000, self.callback)

it seems that an infinite loop is triggered, and the App crushes. Without your changes, it works just fine.
Can you investigate why it happens? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants