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

Liste des GroupesRevenir à cl tcl 
Sujet : 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, 10:55:25
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <104qn2d$1ef5l$1@dont-email.me>
User-Agent : Pan/0.154 (Izium; 517acf4)
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_.

I tried these variations, all of which gave errors:

-variable [my ShowState]
-variable [my $ShowState]
-variable [self ShowState]
-variable [self $ShowState]

For now I'm using a global variable ::ShowState
but I'd really like it to be an instance variable -
if it can be done?

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