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

Bold font in ttk::checkbutton with -style Toolbutton

86 views
Skip to first unread message

Alexandru

unread,
Aug 15, 2023, 1:58:46 AM8/15/23
to
How can I set bold font in a ttk::checkbutton styled with "-style Toolbutton"?
I can define a new style with bold text with:
ttk::style configure Bold.TButton -font MPbold
But then the new style will will not have the "Toolbutton" style.
I need some kind o copy the "Toolbutton" style and then just modify the font.

Thanks
Alexandru

greg

unread,
Aug 15, 2023, 3:52:49 AM8/15/23
to
In Manual 8.7:
https://www.tcl.tk/man/tcl8.7/TkCmd/ttk_style.html
DEFINITIONS: ... The “.” style is the theme root style on which derived styles are based.

or
https://tkdocs.com/tutorial/styles.html


# a example:
package require Tk

ttk::button .b0 -text Hello
ttk::button .b1 -text Hello
ttk::button .b2 -text Hello
ttk::button .b3 -text Hello
pack .b0 .b1 .b2 .b3

ttk::style configure Bold.TButton -font MPbold
ttk::style configure Emergency.Bold.TButton -foreground red -padding 10
ttk::style configure Emergency.TButton -foreground red -padding 10

.b1 configure -style "Bold.TButton"
.b2 configure -style "Emergency.TButton"
.b3 configure -style "Emergency.Bold.TButton"

nemethi

unread,
Aug 15, 2023, 3:54:14 AM8/15/23
to
Am 15.08.23 um 07:58 schrieb Alexandru:
Try

ttk::style configure Bold.Toolbutton -font MPbold
...
ttk::checkbutton .ckbtn -style Bold.Toolbutton ...

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

Alexandru

unread,
Aug 15, 2023, 5:04:29 AM8/15/23
to
Thank you both.
My mistake was indeed, that I used Bold.TButton instead Bold.Toolbutton.
Problem solved.

Regards
Alexandru
0 new messages