O'Reilly logo

Practical Programming in Tcl & Tk, Third Edition by Brent B. Welch

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Editing Interface

Editing and defining a new binding are done in a pair of entry widgets. These widgets are created and packed into the display dynamically when the user presses the New or Edit button:

Example 43-6 An interface to define bindings.


proc Bind_New { frame } { if [catch {frame $frame.edit}f] { # Frame already created set f $frame.edit } else { foreach x {key cmd} { set f2 [frame $f.$x] pack $f2 -fill x -padx 2 label $f2.l -width 11 -anchor e pack $f2.l -side left entry $f2.e pack $f2.e -side left -fill x -expand true bind $f2.e <Return> [list BindDefine $f] } $f.key.l config -text Event: $f.cmd.l config -text Command: } pack $frame.edit ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required