Group: comp.lang.tcl


Subject: "bind" - perhaps a bit more "general" solution possible?
From: ZB
Date: 12/11/2007 6:47:28 PM
I've got a frame, containing several other widgets - it's something like: ttk::frame .frame ttk::label .frame.label1 ttk::label .frame.label2 ttk::entry .frame.entry1 ttk::entry .frame.entry2 ...and so on. I would to bind an exit procedure to every "inner" widget of the frame - it should change the focus (thus leaving the frame / aborting editing) everytime, when <Esc> is pressed. Currently I made it usual way: foreach w [winfo children .frame] { bind $w <Escape> { escPressed %W } } But it's not very elegant, when there are about 20 "children" (besides: I'm not sure about any negative influence of many bindings - does there exist any?). But perhaps it could be solved smarter way? -- ZB