Am 02.06.22 um 20:34 schrieb Harald Oehlmann:
Dear Csaba, dear Tk team,
thank you for great scrollutil 1.15.
The automatic display of the arrows with scrollednotebook is great!
Nevertheless, I face another issue, what is probably me:
Is it possible, that scrollednotebook takes all the width available?
In my case, it never takes additional space.
Here is my code:
toplevel .t1
toplevel .t2
pack [ttk::notebook .t1.n] -side top -fill both -expand true
pack [scrollutil::scrollednotebook .t2.n -width 0 -movabletabs 0]\
-side top -fill both -expand true
.t1.n add [ttk::frame .t1.n.f] -text ttk::notebook
.t2.n add [ttk::frame .t2.n.f2] -text scrollutil::scrollednotebook
pack [ttk::label .t1.n.f.l -text ttk::notebook]
pack [ttk::label .t2.n.f2.l -text scrollutil::scrollednotebook]
The ttk::notebook solution takes all available width, if the window is resized. The scrollutil::scrollednotebook solution only takes its own required size.
Is there any way to take all size ?
Thank you all,
Harald
The scrollutil::scrollednotebook widget .t2.n contains a scrollutil::scrollableframe .t2.n.sf, whose -fitcontentwidth option has
its default value 0. This, together with a positive -width value,
enables the horizontal scrollability in case of a large number of tabs,
unlike the ttk::notebook .t1.n, whose width would become exorbitantly large.
Now, in your sample code above, .t2.n has only one tab, hence there is
no need for horizontal scrollability. Instead, the width of the
ttk::notebook packed into the contentframe of .t2.n.sf should be kept in
sync with that of .t2.n.sf. This is nothing else than
.t2.n.sf configure -fitcontentwidth 1
While the above line solves the reported problem, it makes use of
undocumented informations. It seems that we need a new option to avoid
the necessity for this dirty approach.
--
Csaba Nemethi
https://www.nemethi.de mailto:
[email protected]
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)