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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Binding

Status
Not open for further replies.

akpr

Programmer
Jul 25, 2001
19
US
I have created a class toolbar
it's working nice
Now how do I bind an event <MOTION>

the creation of toolbar as follows

constructor { arg }
set FrmToolbar $arg
}
method show { arg } {

frame $FrmToolbar -borderwidth 2 -background grey -relief raised
frame $FrmToolbar.frminner -borderwidth 1
image create photo imgfileile -file NF.gif
label $FrmToolbar.frminner.image -image imgfileile
pack $FrmToolbar -side top -fill x
pack $FrmToolbar.frminner -side top -fill x
pack $FrmToolbar.frminner.image -side left -fill x
}

Now i want to bind an event for this toolbar

I tried as follows but it did not
bind {$FrmToolbar.frminner.image } <Motion> {

tk_messageBox -icon info -message &quot;You have selected Sss &quot;
}
 
There are two things that I see here and both have to do with the curly braces around the widget name $FrmToolbar.frminner.image in the bind command.

Since there are curly braces surrounding the name, Tcl interprets the widget name to be, literally, &quot;$FrmToolbar.frminner.image &quot;. Meaning, the dollar sign and the space at the end of the name are literally included.

Try removing the the curly braces from around the widget name.

Cheers,

Ed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top