Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

label problem 1

Status
Not open for further replies.

stewang

Programmer
Aug 21, 2003
77
NZ
Code:
Hello all:
Please help me to find out why my program always report 
an error message after I run my code. I am tring to get label behave like a button.

my code as follow;

proc doEnter {} { .label1 configure -borderwidth 3 }
proc doLeave {} { .lable1 configure -borderwidth 1}
proc doPrease {} { .label configure -background lightblue }
proc doRelease {} {.label configure -background white }
proc doCallback {} {puts "Executing callback" }

label .label1 -text "I'm a waannabe button"  -relief solid  -bd 1
pack .label1

bind .label1 <Enter> doEnter

bind .label1 <ButtonPress-1> doPress

bind .label1 <ButtonRelease-1> {doRelease doCallback}

bind .label1 <Leave> doLeave

rgds
stewang
 
You made a number of typos.
Code:
  proc doEnter {} { .label1 configure -borderwidth 3 }
  proc doLeave {} { .label1 configure -borderwidth 1}
  proc doPress {} { .label1 configure -background lightblue }
  proc doRelease {} {.label1 configure -background white }
  proc doCallback {} {puts &quot;Executing callback&quot; }
  label .label1 -text &quot;I'm a waannabe button&quot;  -relief solid  -bd 1
  pack .label1
  bind .label1 <Enter> doEnter
  bind .label1 <ButtonPress-1> doPress
  bind .label1 <ButtonRelease-1> {doRelease; doCallback}
  bind .label1 <Leave> doLeave
Please, check your code before showing it to us.

ulis
 
Thanks ulis, I will be carefull next time.

rgds
stewang
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top