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

    From Harald Oehlmann@21:1/5 to All on Wed Mar 8 18:49:28 2023
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From nemethi@21:1/5 to All on Thu Mar 9 16:35:40 2023
    Am 08.03.23 um 18:49 schrieb Harald Oehlmann:
    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


    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:[email protected]

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Harald Oehlmann@21:1/5 to All on Fri Mar 10 08:20:48 2023
    Am 09.03.2023 um 16:35 schrieb nemethi:
    Am 08.03.23 um 18:49 schrieb Harald Oehlmann:
    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


    Hi Harald,

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

    Best regards,

    Csaba


    That is great, thank you !

    Take care,
    Harald

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)