Re: How to set ttk::radiobutton -variable to an object's instance variable?

Liste des GroupesRevenir à cl tcl 
Sujet : Re: How to set ttk::radiobutton -variable to an object's instance variable?
De : m.n.summerfield (at) *nospam* gmail.com (Mark Summerfield)
Groupes : comp.lang.tcl
Date : 11. Jul 2025, 16:21:52
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <104ra6g$1iid4$1@dont-email.me>
References : 1 2
User-Agent : Pan/0.154 (Izium; 517acf4)
On Fri, 11 Jul 2025 13:28:06 +0200, Schelte wrote:

On 11/07/2025 11:55, Mark Summerfield wrote:
Given this class:
 
oo::class create App {
     # ...
     variable ShowState
}
 
And this method:
 
oo::define App method make_controls {} {
     # ...
     ttk::radiobutton .controlsFrame.showFrame.asIsRadio \
         -text "Show as-is" -value asis -variable ShowState
     set ShowState asis
 
The variable given to the radio button and the instance variable
are_different_.
 
     ttk::radiobutton .controlsFrame.showFrame.asIsRadio \
       -text "Show as-is" -value asis -variable [my varname ShowState]
 
 
Schelte.

That silently didn't work.
I also tried `-variable [my variable ShowState]` and that didn't work
either.

I don't use snit so I couldn't use that approach either.

Given that Tcl 9 has the incredibly useful `callback` command
which I use all the time with Tk widgets for their `-command`
options, I'm surprised there isn't an equivalent for Tk widget
variables: or perhaps there is and I haven't found it?

Date Sujet#  Auteur
11 Jul 25 * How to set ttk::radiobutton -variable to an object's instance variable?6Mark Summerfield
11 Jul 25 +- Re: How to set ttk::radiobutton -variable to an object's instance? variable?1Robert Heller
11 Jul 25 `* Re: How to set ttk::radiobutton -variable to an object's instance variable?4Mark Summerfield
12 Jul 25  +* Re: How to set ttk::radiobutton -variable to an object's instance variable?2Emiliano
12 Jul 25  i`- Re: How to set ttk::radiobutton -variable to an object's instance variable?1et99
14 Jul 25  `- Re: How to set ttk::radiobutton -variable to an object's instance variable?1Mark Summerfield

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal