- 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 ..."
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
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
}
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,
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
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. :-(
| Sysop: | Keyop |
|---|---|
| Location: | Huddersfield, West Yorkshire, UK |
| Users: | 715 |
| Nodes: | 16 (2 / 14) |
| Uptime: | 07:54:44 |
| Calls: | 12,100 |
| Files: | 15,003 |
| Messages: | 6,517,941 |