• scrollutil::plainnotebook and label font

    From Harald Oehlmann@21:1/5 to All on Fri Mar 11 10:00:42 2022
    Csaba,
    I am sorry, internet breakdown in Berlin since 2 days. I can not read
    your answer.

    I finally understood the intention of scrollutil::pagesman. It is a
    nested page. But the nested items do not show below the folder tabs, but
    open a new list which features a back button. That is great, but does
    not help for my use-case of a two level configuration menu.

    But I got a great solution:
    - Use only a one level configuration menu, flaten the items. Anyway, I
    have only introduced a two level menu, because around 100 ttk::notebook
    tabs were not supported, as the screen is always to short.

    For my configuration page, I use now:
    * ttk::notebook if there are 5 tabs maxi
    * scrollutil::plainnotebook if there are more tabs. There can be up to 100.

    This looks great. The interface is identical, only the creation command
    has to be exchanged.

    Now, the next task with plainnotebook:
    I use named fonts to resize the whole interface. Is it possible to use a
    named font for the plainnotebook font?

    The labels are ttk::buttons -style Toolbutton.
    I would like to use ttk::button -style Elmi.Toolbutton to use a custom
    font, as I use for toolbuttons normally:
    ttk::style configure Elmi.Toolbutton -font LabelFont
    ttk::button .. -style Elmi.Toolbutton

    In addition, I would be happy, if the widget would be world-change aware
    (if not already).

    It would also be great, if a label (within plainnotebook) could have a different style, than the buttons. I use bold title labels.

    Thank you, great work !
    Harald

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From nemethi@21:1/5 to All on Fri Mar 11 22:01:55 2022
    Am 11.03.22 um 21:52 schrieb nemethi:
    - The addlabel and insertlabel subcommand create a "tab" implemented as
    a ttk::label whose font is derived from TkDefaultFont (it has an
    increased size, which is updated whenever a <<TkWorldChanged>> event
    with %d = "FontChanged" is received).  You can get the path name of this ttk::label with the tabpath subcommand and then change its font by
    invoking "... configure -font ..."

    A simpler way: The addlabel and insertlabel subcommands return the path
    name of the ttk::label they create. Hence no need for a tabpath
    invocation. I will add this to the manual.

    --
    Csaba Nemethi https://www.nemethi.de mailto:[email protected]

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From nemethi@21:1/5 to All on Fri Mar 11 21:52:39 2022
    Am 11.03.22 um 10:00 schrieb Harald Oehlmann:
    Csaba,
    I am sorry, internet breakdown in Berlin since 2 days. I can not read
    your answer.

    I finally understood the intention of scrollutil::pagesman. It is a
    nested page. But the nested items do not show below the folder tabs, but
    open a new list which features a back button. That is great, but does
    not help for my use-case of a two level configuration menu.

    But I got a great solution:
    - Use only a one level configuration menu, flaten the items. Anyway, I
    have only introduced a two level menu, because around 100 ttk::notebook
    tabs were not supported, as the screen is always to short.

    For my configuration page, I use now:
    * ttk::notebook if there are 5 tabs maxi
    * scrollutil::plainnotebook if there are more tabs. There can be up to 100.

    This looks great. The interface is identical, only the creation command
    has to be exchanged.

    Now, the next task with plainnotebook:
    I use named fonts to resize the whole interface. Is it possible to use a named font for the plainnotebook font?

    The labels are ttk::buttons -style Toolbutton.
    I would like to use ttk::button -style Elmi.Toolbutton to use a custom
    font, as I use for toolbuttons normally:
        ttk::style configure Elmi.Toolbutton -font LabelFont
        ttk::button .. -style Elmi.Toolbutton

    In addition, I would be happy, if the widget would be world-change aware
    (if not already).

    It would also be great, if a label (within plainnotebook) could have a different style, than the buttons. I use bold title labels.

    Thank you, great work !
    Harald

    The notebook component $pnb.nb of a plainnotebook widget $pnb is a ttk::notebook of the style Plainnotebook.TNotebook, whose tabs are
    hidden, hence it makes not much sense to speak of "the plainnotebook
    font". You meant probably the font used for the toolbuttons that play
    the role of the tabs of a ttk::notebook widget. Notice that it is not
    correct to call them "labels", because:

    - The add and insert subcommands create a page and a corresponding
    "tab", which is a ttk::radiobutton of the style Page.Toolbutton or ClosablePage.Toolbutton.

    - The addbuton and insertbutton subcommands create a "tab" implemented
    as a ttk::button of the style Desc.Toolbutton.

    - The addlabel and insertlabel subcommand create a "tab" implemented as
    a ttk::label whose font is derived from TkDefaultFont (it has an
    increased size, which is updated whenever a <<TkWorldChanged>> event
    with %d = "FontChanged" is received). You can get the path name of this ttk::label with the tabpath subcommand and then change its font by
    invoking "... configure -font ..."

    You can set the font used for the styles Page.Toolbutton,
    Desc.Toolbutton, and Desc.Toolbutton with the standard method:

    foreach style {Page.Toolbutton ClosablePage.Toolbutton
    Desc.Toolbutton} {
    ttk::style configure $style -font your_LabelFont
    }

    Good luck!

    --
    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 Sat Mar 12 08:11:38 2022
    Am 11.03.2022 um 21:52 schrieb nemethi:
    Am 11.03.22 um 10:00 schrieb Harald Oehlmann:
    Csaba,
    I am sorry, internet breakdown in Berlin since 2 days. I can not read
    your answer.

    I finally understood the intention of scrollutil::pagesman. It is a
    nested page. But the nested items do not show below the folder tabs,
    but open a new list which features a back button. That is great, but
    does not help for my use-case of a two level configuration menu.

    But I got a great solution:
    - Use only a one level configuration menu, flaten the items. Anyway, I
    have only introduced a two level menu, because around 100
    ttk::notebook tabs were not supported, as the screen is always to short.

    For my configuration page, I use now:
    * ttk::notebook if there are 5 tabs maxi
    * scrollutil::plainnotebook if there are more tabs. There can be up to
    100.

    This looks great. The interface is identical, only the creation
    command has to be exchanged.

    Now, the next task with plainnotebook:
    I use named fonts to resize the whole interface. Is it possible to use
    a named font for the plainnotebook font?

    The labels are ttk::buttons -style Toolbutton.
    I would like to use ttk::button -style Elmi.Toolbutton to use a custom
    font, as I use for toolbuttons normally:
         ttk::style configure Elmi.Toolbutton -font LabelFont
         ttk::button .. -style Elmi.Toolbutton

    In addition, I would be happy, if the widget would be world-change
    aware (if not already).

    It would also be great, if a label (within plainnotebook) could have a
    different style, than the buttons. I use bold title labels.

    Thank you, great work !
    Harald

    The notebook component $pnb.nb of a plainnotebook widget $pnb is a ttk::notebook of the style Plainnotebook.TNotebook, whose tabs are
    hidden, hence it makes not much sense to speak of "the plainnotebook
    font".  You meant probably the font used for the toolbuttons that play
    the role of the tabs of a ttk::notebook widget.  Notice that it is not correct to call them "labels", because:

    - The add and insert subcommands create a page and a corresponding
    "tab", which is a ttk::radiobutton of the style Page.Toolbutton or ClosablePage.Toolbutton.

    - The addbuton and insertbutton subcommands create a "tab" implemented
    as a ttk::button of the style Desc.Toolbutton.

    - The addlabel and insertlabel subcommand create a "tab" implemented as
    a ttk::label whose font is derived from TkDefaultFont (it has an
    increased size, which is updated whenever a <<TkWorldChanged>> event
    with %d = "FontChanged" is received).  You can get the path name of this ttk::label with the tabpath subcommand and then change its font by
    invoking "... configure -font ..."

    You can set the font used for the styles Page.Toolbutton,
    Desc.Toolbutton, and Desc.Toolbutton with the standard method:

        foreach style {Page.Toolbutton ClosablePage.Toolbutton
                       Desc.Toolbutton} {
            ttk::style configure $style -font your_LabelFont
        }

    Great, Csaba !
    Thank you, great. It is funny, that ttk::label has a font option, as
    this should happen via styles.
    So, I will try this.
    Nevertheless, I would find it useful, if the style of the widgets could
    be specified on the create commands, so it could even feature different
    styles of different labels within one plainnotebook widget.

    Thank you again,
    Harald

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Harald Oehlmann@21:1/5 to All on Mon Mar 14 09:46:01 2022
    Am 11.03.2022 um 21:52 schrieb nemethi:
    Am 11.03.22 um 10:00 schrieb Harald Oehlmann:
    Csaba,
    I am sorry, internet breakdown in Berlin since 2 days. I can not read
    your answer.

    I finally understood the intention of scrollutil::pagesman. It is a
    nested page. But the nested items do not show below the folder tabs,
    but open a new list which features a back button. That is great, but
    does not help for my use-case of a two level configuration menu.

    But I got a great solution:
    - Use only a one level configuration menu, flaten the items. Anyway, I
    have only introduced a two level menu, because around 100
    ttk::notebook tabs were not supported, as the screen is always to short.

    For my configuration page, I use now:
    * ttk::notebook if there are 5 tabs maxi
    * scrollutil::plainnotebook if there are more tabs. There can be up to
    100.

    This looks great. The interface is identical, only the creation
    command has to be exchanged.

    Now, the next task with plainnotebook:
    I use named fonts to resize the whole interface. Is it possible to use
    a named font for the plainnotebook font?

    The labels are ttk::buttons -style Toolbutton.
    I would like to use ttk::button -style Elmi.Toolbutton to use a custom
    font, as I use for toolbuttons normally:
         ttk::style configure Elmi.Toolbutton -font LabelFont
         ttk::button .. -style Elmi.Toolbutton

    In addition, I would be happy, if the widget would be world-change
    aware (if not already).

    It would also be great, if a label (within plainnotebook) could have a
    different style, than the buttons. I use bold title labels.

    Thank you, great work !
    Harald

    The notebook component $pnb.nb of a plainnotebook widget $pnb is a ttk::notebook of the style Plainnotebook.TNotebook, whose tabs are
    hidden, hence it makes not much sense to speak of "the plainnotebook
    font".  You meant probably the font used for the toolbuttons that play
    the role of the tabs of a ttk::notebook widget.  Notice that it is not correct to call them "labels", because:

    - The add and insert subcommands create a page and a corresponding
    "tab", which is a ttk::radiobutton of the style Page.Toolbutton or ClosablePage.Toolbutton.

    - The addbuton and insertbutton subcommands create a "tab" implemented
    as a ttk::button of the style Desc.Toolbutton.

    - The addlabel and insertlabel subcommand create a "tab" implemented as
    a ttk::label whose font is derived from TkDefaultFont (it has an
    increased size, which is updated whenever a <<TkWorldChanged>> event
    with %d = "FontChanged" is received).  You can get the path name of this ttk::label with the tabpath subcommand and then change its font by
    invoking "... configure -font ..."

    You can set the font used for the styles Page.Toolbutton,
    Desc.Toolbutton, and Desc.Toolbutton with the standard method:

        foreach style {Page.Toolbutton ClosablePage.Toolbutton
                       Desc.Toolbutton} {
            ttk::style configure $style -font your_LabelFont
        }

    Good luck!


    Thank you !
    I used the style method and it works great.

    Thanks,
    Harald

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Harald Oehlmann@21:1/5 to All on Mon Mar 14 09:52:41 2022
    Csaba,

    thanks for scrollutil::plainnotebook. It solves the issue for me, to
    organize a lot of tabs of my property dialog. The dialog may have 20 tabs.

    Please allow me to add some thoughts:
    - I would find it beautiful, if the new tabs would share the optical
    look of the ttk::notebook tabs. The later have white background on
    Windows Vista theme. The current plainnotebook tab theme background is grey.

    - We have added the ability to cycle through the ttk::notebook tabs
    using the scrollwheel (thanks for your support for that). The
    plainnotebook tabs scroll the scrollbar of the tab region with the
    scrollwheel. Nevertheless, it would be beautiful, to cycle through the
    tabs with the scrollwheel.

    Thank you again for the great set of widgets,
    Harald

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From nemethi@21:1/5 to All on Mon Mar 14 18:11:33 2022
    Am 14.03.22 um 09:52 schrieb Harald Oehlmann:

    Csaba,

    thanks for scrollutil::plainnotebook. It solves the issue for me, to
    organize a lot of tabs of my property dialog. The dialog may have 20 tabs.

    Please allow me to add some thoughts:
    - I would find it beautiful, if the new tabs would share the optical
    look of the ttk::notebook tabs. The later have white background on
    Windows Vista theme. The current plainnotebook tab theme background is
    grey.

    - We have added the ability to cycle through the ttk::notebook tabs
    using the scrollwheel (thanks for your support for that). The
    plainnotebook tabs scroll the scrollbar of the tab region with the scrollwheel. Nevertheless, it would be beautiful, to cycle through the
    tabs with the scrollwheel.

    Thank you again for the great set of widgets,
    Harald

    On my Windows 11 laptop, the background color of the ttk::notebook tabs
    is #f3f3f3, except the selected one, whose background color is #f9f9f9.
    To change the background color of the plainnotebook "tabs", you can use

    foreach style {Page.Toolbutton ClosablePage.Toolbutton} {
    ttk::style configure $style -background #f3f3f3
    }

    You can do the same for the style Desc.Toolbutton if you like. It is
    also easy to change the background color of the ttk::label widgets
    created with the addlabel and insertlabel subcommands.

    Notice, however, that the attempt to change the background color of the selected "tab" via

    foreach style {Page.Toolbutton ClosablePage.Toolbutton} {
    ttk::style map $style -background {selected #f9f9f9}
    }

    has no effect for the vista theme. Consequently, it is probably not
    possible to have exactly the same plainnotebook "tab" colors as for the ttk::notebook tabs.

    I will come back to the scroll wheel subject in a separate posting.

    --
    Csaba Nemethi https://www.nemethi.de mailto:[email protected]

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From nemethi@21:1/5 to All on Mon Mar 14 20:31:23 2022
    Am 14.03.22 um 18:11 schrieb nemethi:
    Am 14.03.22 um 09:52 schrieb Harald Oehlmann:

    Csaba,

    thanks for scrollutil::plainnotebook. It solves the issue for me, to
    organize a lot of tabs of my property dialog. The dialog may have 20
    tabs.

    Please allow me to add some thoughts:
    - I would find it beautiful, if the new tabs would share the optical
    look of the ttk::notebook tabs. The later have white background on
    Windows Vista theme. The current plainnotebook tab theme background is
    grey.

    - We have added the ability to cycle through the ttk::notebook tabs
    using the scrollwheel (thanks for your support for that). The
    plainnotebook tabs scroll the scrollbar of the tab region with the
    scrollwheel. Nevertheless, it would be beautiful, to cycle through the
    tabs with the scrollwheel.

    Thank you again for the great set of widgets,
    Harald

    On my Windows 11 laptop, the background color of the ttk::notebook tabs
    is #f3f3f3, except the selected one, whose background color is #f9f9f9.
     To change the background color of the plainnotebook "tabs", you can use

        foreach style {Page.Toolbutton ClosablePage.Toolbutton} {
            ttk::style configure $style -background #f3f3f3
        }

    You can do the same for the style Desc.Toolbutton if you like.  It is
    also easy to change the background color of the ttk::label widgets
    created with the addlabel and insertlabel subcommands.

    Notice, however, that the attempt to change the background color of the selected "tab" via

        foreach style {Page.Toolbutton ClosablePage.Toolbutton} {
            ttk::style map $style -background {selected #f9f9f9}
        }

    has no effect for the vista theme.  Consequently, it is probably not possible to have exactly the same plainnotebook "tab" colors as for the ttk::notebook tabs.

    I will come back to the scroll wheel subject in a separate posting.


    For your proposal that the scroll wheel should cycle through the
    plainnotebook "tabs", I will need much more spare time than I have right
    now. :-(

    --
    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 Mon Mar 14 21:37:08 2022
    Am 14.03.2022 um 20:31 schrieb nemethi:
    For your proposal that the scroll wheel should cycle through the plainnotebook "tabs", I will need much more spare time than I have right
    now. :-(

    Dear Csaba,

    All great like it is. The new widget is so helpful, thank you a lot.

    Unfortunately, I will not be in next TUGM Telco, nor TCL meeting (only,
    if early in the morning).

    Take care,
    Harald

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