PyGubu is a simple Python program that allows to create UI interfaces with Tkinter widgets.
So I have created an UI like this one here on the right
Now, I want that Scrollbar to be as big as the Text widget.
"How can I make the Scrollbar bigger on Tkinter" has been asked many times on StackOverflow. In my case, I cannot use the functions pack() or grid() as I am importing an already semi-finished UI
The code I use to load the Text and the Scrollbar is as the following:
self.log = builder.get_object('log')
self.log_scroll = builder.get_object('log_scroll')
self.log.config(yscrollcommand=self.log_scroll.set)
self.log_scroll.config(command=self.log.yview)
Now, I see two possibilities here:
The easiest way should be setting some attributes from PyGubu to solve this. Yet, PyGubu allows me to change only a minor number of attributes of the Scrollbar, and none of them seems to be relevant
And here I have no idea about what to do. I don't know if I can use pack() and grid() while using a custom-made interface
Any help is appreciated
While writing the question, I've found a not-so-intuitive answer, still the best one:
The property "sticky" is the one who can solve the problem. What is not-so-intuitive is that you can select multiple squares ctrl+click. If you are used to work with Tkinter, it would probably not surprise you, but in my case (first day with Tkinter) I can just consider myself lucky
Should be
sticky='ns'
, thererfore you habe to select the mid top and mid bottom.@stovfl You cannot do that apparently. To set
sticky='ns'
(which is correct, that is what I needed to do) you need to select the mid top, the mid bottom AND the central one :PWhat is central on only, supposed to set?
It's like not setting sticky at all, from what I can see. Same thing if you want to set
sticky='we'
: you have to select the central one as well. If you want nesw, you probably need to select all the nine squares (I need to check)