• A ttk::style question

    From Helmut Giese@21:1/5 to All on Mon Jun 9 00:44:18 2025
    Hello out there,
    I want to configure the font of a ttk::radiobutton - but how?
    I found 'ttk::style element names', but the call returned a list
    starting (when sorted) with 'Combobox.background' and ending with 'Vertical.Scrollbar.uparrow' - but no mention of either 'radiobutton'
    or 'label'.
    I am out of ideas. Any help will be greatly appreciated.
    Helmut

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Schelte@21:1/5 to Helmut Giese on Mon Jun 9 01:04:56 2025
    On 09/06/2025 00:44, Helmut Giese wrote:
    I want to configure the font of a ttk::radiobutton - but how?

    Assuming you don't want all your radiobuttons to have the special font,
    invent a name for a style that inherits from the normal style for a radiobutton; TRadiobutton. Configure the font for that derived style.
    Then use that style for your radiobutton:

    ttk::style configure Fixed.TRadiobutton -font TkFixedFont
    ttk::radiobutton .b -style Fixed.TRadiobutton -text Hello


    Schelte.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Helmut Giese@21:1/5 to All on Mon Jun 9 01:51:40 2025
    Hi Schelte,
    you saved my day, many thanks (and so fast, too).
    Maybe one more question:
    Is there some source (tutorial, collection of texts, or similar)
    where one could learn the basics of working with styles? Anthing?
    Thanks again
    Helmut

    On 09/06/2025 00:44, Helmut Giese wrote:
    I want to configure the font of a ttk::radiobutton - but how?

    Assuming you don't want all your radiobuttons to have the special font, >invent a name for a style that inherits from the normal style for a >radiobutton; TRadiobutton. Configure the font for that derived style.
    Then use that style for your radiobutton:

    ttk::style configure Fixed.TRadiobutton -font TkFixedFont
    ttk::radiobutton .b -style Fixed.TRadiobutton -text Hello


    Schelte.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From nemethi@21:1/5 to All on Mon Jun 9 13:20:24 2025
    Am 09.06.25 um 01:51 schrieb Helmut Giese:
    Hi Schelte,
    you saved my day, many thanks (and so fast, too).
    Maybe one more question:
    Is there some source (tutorial, collection of texts, or similar)
    where one could learn the basics of working with styles? Anthing?
    Thanks again
    Helmut

    On 09/06/2025 00:44, Helmut Giese wrote:
    I want to configure the font of a ttk::radiobutton - but how?

    Assuming you don't want all your radiobuttons to have the special font,
    invent a name for a style that inherits from the normal style for a
    radiobutton; TRadiobutton. Configure the font for that derived style.
    Then use that style for your radiobutton:

    ttk::style configure Fixed.TRadiobutton -font TkFixedFont
    ttk::radiobutton .b -style Fixed.TRadiobutton -text Hello


    Schelte.


    See https://tkdocs.com/tutorial/styles.html by Mark Roseman.

    --
    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 Jun 9 15:12:40 2025
    Am 09.06.25 um 13:36 schrieb Alan Grunwald:
    On 09/06/2025 12:20, nemethi wrote:
    Am 09.06.25 um 01:51 schrieb Helmut Giese:
    Hi Schelte,
    you saved my day, many thanks (and so fast, too).
    Maybe one more question:
    Is there some source (tutorial, collection of  texts, or similar)
    where one could learn the basics of working with styles? Anthing?
    Thanks again
    Helmut

    On 09/06/2025 00:44, Helmut Giese wrote:
    I want to configure the font of a ttk::radiobutton - but how?

    Assuming you don't want all your radiobuttons to have the special font, >>>> invent a name for a style that inherits from the normal style for a
    radiobutton; TRadiobutton. Configure the font for that derived style.
    Then use that style for your radiobutton:

    ttk::style configure Fixed.TRadiobutton -font TkFixedFont
    ttk::radiobutton .b -style Fixed.TRadiobutton -text Hello


    Schelte.


    See https://tkdocs.com/tutorial/styles.html by Mark Roseman.


    That's great, Csaba, thank you. I've been looking for ages for something
    that explained Ttk styles in a way that was natural to me, and this may
    well be it. Is there any thing similar to explain how to modify layouts? (Assuming it's possible.)

    Alan

    If you go to the Wiki page https://wiki.tcl-lang.org/ and type
    "ttk::style layout" into the Search field, you will get a series of
    useful articles about this subject.

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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From greg@21:1/5 to All on Mon Jun 9 15:41:19 2025
    Am 09.06.25 um 01:51 schrieb Helmut Giese:
    Hi Schelte,
    you saved my day, many thanks (and so fast, too).
    Maybe one more question:
    Is there some source (tutorial, collection of texts, or similar)
    where one could learn the basics of working with styles? Anthing?
    Thanks again
    Helmut

    On 09/06/2025 00:44, Helmut Giese wrote:
    I want to configure the font of a ttk::radiobutton - but how?

    Assuming you don't want all your radiobuttons to have the special font,
    invent a name for a style that inherits from the normal style for a
    radiobutton; TRadiobutton. Configure the font for that derived style.
    Then use that style for your radiobutton:

    ttk::style configure Fixed.TRadiobutton -font TkFixedFont
    ttk::radiobutton .b -style Fixed.TRadiobutton -text Hello


    Schelte.


    Hello,

    just the one tutorial already mentioned,
    otherwise a few links to the theme:

    https://tkdocs.com/tutorial/styles.html https://stackoverflow.com/questions/48050219/customize-ttkbutton https://wiki.tcl-lang.org/page/Changing+Widget+Colors



    Manuals
    https://www.tcl-lang.org/man/tcl/TkCmd/ttk_intro.htm https://www.tcl-lang.org/man/tcl/TkCmd/ttk_widget.htm https://www.tcl-lang.org/man/tcl/TkCmd/ttk_style.htm https://www.tcl-lang.org/man/tcl/TkCmd/ttk_image.htm https://www.tcl-lang.org/man/tcl/TkCmd/ttk_vsapi.htm

    older
    https://tktable.sourceforge.net/tile/ https://tktable.sourceforge.net/tile/tile-tcl2004.pdf

    Windows
    https://fossies.org/linux/tk/library/ttk/vistaTheme.tcl https://fossies.org/linux/tk/library/ttk/xpTheme.tcl https://fossies.org/linux/tk/library/ttk/winTheme.tcl

    https://www.tcl.tk/man/tcl8.6/TkCmd/ttk_vsapi.htm https://fossies.org/linux/tk/tests/ttk/vsapi.test

    Deutsch/German (im Buch)
    http://www.tcltk.info/index.html

    greg

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Helmut Giese@21:1/5 to All on Tue Jun 10 03:50:20 2025
    Hello all,
    I am simply overwhelmed: so many infos - and so much to study :(
    Many thanks to all of you
    Helmut

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Harald Oehlmann@21:1/5 to All on Tue Jun 10 08:08:49 2025
    Am 10.06.2025 um 03:50 schrieb Helmut Giese:
    Hello all,
    I am simply overwhelmed: so many infos - and so much to study :(
    Many thanks to all of you
    Helmut

    Yes, Helmut,
    15 years ago, I figured out how to change the fonts of all ttk widgets.
    You normally find this info on the wiki widget page ;-)
    Harald

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