**In place edit** (This is my first page on the Wiki, so please forgive me if I make some mistake.) I'm experimenting in Tcl/Tk some ui concepts often found in applications out there. The one I'm showing you this time is what I called "in place edit": a (sort of) widget linked to another one which you can use to change a value of the latter without opening dialog boxes. To be practical, this could be a sample use of the IPE (In Place Edit): 1. you bind the IPE to a label event; 2. when the event is fired, a special entry widget appears, showing the text of the label; 3. you change the text as you wish; 4. if you hit Esc, or click somewhere out of the IPE, or change the keyboard focus, the IPE disappears and nothing happens; 5. otherwise, if you hit Enter (currently, not on the numeric pad), your changes are committed and the label text is modified. Please note that this is a (simple) experiment and not ''production ready code''. Moreover, I'm testing the code on Linux and fixing it for that system (however, it seems to work on Windows, too). First, let's see some pictures of the code in action! Here, I change the text of a label, by double-clicking on it, editing it, and finally hitting Enter. [http://freeasinfreedom.altervista.org/fp-content/images/ipe01.png] [http://freeasinfreedom.altervista.org/fp-content/images/ipe02.png] [http://freeasinfreedom.altervista.org/fp-content/images/ipe03.png] [http://freeasinfreedom.altervista.org/fp-content/images/ipe04.png] Here, I do the same with a button, but double-right-clicking on it! [http://freeasinfreedom.altervista.org/fp-content/images/ipe05.png] Finally, let's see how the code works with toplevel captions too (by double-clicking on the toplevel empty area): [http://freeasinfreedom.altervista.org/fp-content/images/ipe06.png] [http://freeasinfreedom.altervista.org/fp-content/images/ipe07.png] [http://freeasinfreedom.altervista.org/fp-content/images/ipe08.png] Now, this is the code I used: it contains both the code for the IPE and that for the usage samples. ====== namespace eval ipe { variable ipe variable tl variable tlbtnbind variable outvar } proc ipe::init {} { variable ipe set ipe [toplevel .ipe] wm withdraw $ipe wm protocol $ipe WM_DELETE_WINDOW ipe::hide wm attributes .ipe -topmost 1 wm overrideredirect .ipe 1 ttk::frame $ipe.f pack $ipe.f ttk::entry $ipe.f.e pack $ipe.f.e bind $ipe.f.e [list ipe::hide 1] bind $ipe.f.e ipe::hide bind $ipe.f ipe::hide } proc ipe::hide {{store 0}} { variable ipe variable outvar variable tl variable tlbtnbind bind $tl