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

ttk:checkbutton is missing the toggle command?

74 views
Skip to first unread message

Alexandru

unread,
Mar 26, 2021, 1:49:30 PM3/26/21
to
I was assuming, that the ttk:checkbutton has the same commands as the checkbutton but I was wrong(?)

E.g. the "toggle" command in not available for the themed version?

Alexandru

unread,
Mar 26, 2021, 1:50:47 PM3/26/21
to
Alexandru schrieb am Freitag, 26. März 2021 um 18:49:30 UTC+1:
> I was assuming, that the ttk:checkbutton has the same commands as the checkbutton but I was wrong(?)
>
> E.g. the "toggle" command in not available for the themed version?
Same vor the "select" and "deselect" commands...

Rich

unread,
Mar 26, 2021, 1:59:20 PM3/26/21
to
The Tk checkbutton's "toggle" command is the ttk::checkbutton's
"invoke" command.

pathname invoke
*Toggles* between the selected and deselected states and
evaluates the associated -command. If the widget is
currently selected, sets the -variable to the -offvalue
and deselects the widget; otherwise, sets the -variable
to the -onvalue Returns the result of the -command.

Rich

unread,
Mar 26, 2021, 2:07:22 PM3/26/21
to
The "select" and "deselect" commands were subsumed into the state
mechansim.

See the ttk_intro and ttk_widget man pages.

The Tk select is now:

widgetname state selected

And the Tk deselect is now:

widgetname state !selected

Alexandru

unread,
Mar 27, 2021, 1:38:02 AM3/27/21
to
Thanks for the explanations.
I see that now. I was naive to think, that the themed widgets are same old widgets with an added -style option and removed old specific styling options such as -fg.
Since I always propagate the use of ttk widgets over the old widgets, I realize the difficulty for old codes to "simply" switch the technology from old to new. Maybe this is one of the reasons why we still see lots of the old UIs out there. That's a pitty.
0 new messages