-
Notifications
You must be signed in to change notification settings - Fork 348
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
ScrolledFrame Behavior #140
Comments
This may be related to the issue when using pack and place together. However, this gave me a clue of how to fix this, which I was partially implementing already. I just needed to assign a height as well as width so that the pack and place managers have a point of reference. When doing this, I get this result. Also, this line is not needed, and should probably be avoided as the frm no longer has control of the geometry when you delegate it to the notebook. self.frm.place(relx=0, rely=0, relwidth=1, relheight=1) Instead, you would use the self.nb.add(self.frm.container, text='Test', sticky=NSEW) Finally, a tip on using class MainFrame(ttk.Window):
def __init__(self):
ttk.Window.__init__(self, size=(500, 300), title="Tkinter") I'll push a fix on this soon after I run a few more tests. |
@antrrax, confirm if you can that this fixes your issue. I was able to test it successfully on my end, but I want to make sure. |
I tested it with the same code as in the first post. At first the problem was solved. |
@antrrax, I'm reworking this widget, and the fix above actually created another problem. However, I now realize why this isn't working above and how to fix it. This is a unique case with using place and relative positioning so it took a while to figure out exactly why this should work, and why my fix caused other issues. The height of the frame is determined by either the contents or a fixed size that you specify. This is what makes the content frame scrollable relative to the container frame. To fix the issue above, you would simply give the scrolled frame a height. |
@antrrax, the scrolled frame has a default width and height like the Canvas widget, however, you can override with pack, place, grid, just as with any other widget. I've added a new parameter called self.frm = ScrolledFrame(self, autohide=True, scrollheight=300) |
Is this a bug or expected behavior?
This code generates this layout:
Scrolled:
If I replace the frame (self.frm) with a ScrolledFrame, see how the layout changes: the widget with .place was not displayed and the frame side=bottom does not obey the bottom position:
The text was updated successfully, but these errors were encountered: