Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

TCL(Tool Command Language) Scripting

Making A Toggle Button


Hi all, I've been trying to mimic a Java toggle button in TK but every
time i use my own implementation  I have to press the button three
times before it becomes sunken.

Heres a quick overview of the button presses:
Starts off raised.
Press once - should be sunken but stays raised
press again - stays raised but it should be at this point
press again - the button goes sunken
and from here on in the button acts like i want it to, its just the
first time i use it.

Here's the code im using if anyone can help me:

    if {$phaseInverterActive == "true"} {
        set phaseInverterActive "false"
        .phaseInverterButton conf -relief raised
    } else {
        set phaseInverterActive "true"
        .phaseInverterButton conf -relief sunken
    }

thanks in advance,
Flamingo11

"Flamingo11" <andrew.lamm@gmail.com> wrote in message

news:1173972765.700842.203660@n76g2000hsh.googlegroups.com...

> Hi all, I've been trying to mimic a Java toggle button in TK but
> every
> time i use my own implementation  I have to press the button three
> times before it becomes sunken.

Is this what you want?

checkbutton .c1 -indicatoron 0 -text "My Button"
pack .c1

Jeff

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc