• Bold font in ttk::checkbutton with -style Toolbutton

    From Alexandru@21:1/5 to All on Mon Aug 14 22:58:41 2023
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From nemethi@21:1/5 to All on Tue Aug 15 09:54:09 2023
    Am 15.08.23 um 07:58 schrieb Alexandru:
    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

    Try

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

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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From greg@21:1/5 to Alexandru on Tue Aug 15 00:52:45 2023
    Alexandru schrieb am Dienstag, 15. August 2023 um 07:58:46 UTC+2:
    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

    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"

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alexandru@21:1/5 to nemethi on Tue Aug 15 02:04:25 2023
    nemethi schrieb am Dienstag, 15. August 2023 um 09:54:14 UTC+2:
    Am 15.08.23 um 07:58 schrieb Alexandru:
    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
    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

    Thank you both.
    My mistake was indeed, that I used Bold.TButton instead Bold.Toolbutton. Problem solved.

    Regards
    Alexandru

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