Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

scrollutil::scrollednotebook with -width exactly max(pane width)

42 views
Skip to first unread message

Harald Oehlmann

unread,
Mar 8, 2023, 12:50:16 PM3/8/23
to
Dear Csaba, dear Tk experts,

Thanks for great "scrollutil::scrollednotebook".

I would like to have the width of a notebook exactly equal to the
maximum of the width of the managed frames.
The same for the height.

In BWidget, there is the command compute_size to update the widget on
any changed sizes.

What I observe with
scrollutil::scrollednotebook -width 0 -height 0

1) If the tabs take more space than the clients, the widget is enlarged.
2) if the content frame resizes, the widget resizes in x direction, but
not in y direction. In my case, resize is triggered by font size change.
The tab label font is also changed, and the tabs correctly resize.

It would be great to have an option or a method to resize to max of
client windows.

When I read Csabas doc, I see that this is a certain mess:

Unlike the ttk::notebook widget, whose -width option is quite often
overridden by the total width of the tabs, the scrollednotebook widget
respects the value of its -width option, regardless of the space
required by the tabs.

-> is there potential for a bug report for Tk?

-width: If present and greater than zero, specifies the desired width
for the widget in any of the forms acceptable to Tk_GetPixels.
Otherwise, the widget's width is set to the requested width of the
ttk::notebook contained in it (which in turn depends, among others, on
the maximum width of all panes and the total width of the tabs),
immediately after the scrollednotebook gets mapped. The default is 10c,
which should be overridden with a suitable application-specific value.

Thank you all,
Harald

nemethi

unread,
Mar 9, 2023, 10:35:45 AM3/9/23
to
Am 08.03.23 um 18:49 schrieb Harald Oehlmann:
Hi Harald,

Many thanks for your proposal! I will implement it for the next
Scrollutil release.

Best regards,

Csaba

--
Csaba Nemethi https://www.nemethi.de mailto:csaba....@t-online.de

Harald Oehlmann

unread,
Mar 10, 2023, 2:20:50 AM3/10/23
to
That is great, thank you !

Take care,
Harald
0 new messages