Entry event
Hello everyone,
I have a problem when I try to launch an action after a change of my entry. My entry is define by :
set listing [list '0' '1' '2' '3' '4'];
set entry2 [hwt::AddEntry $frame2.entry2 \
label 'Choose :' \
labelWidth $labelWidth \
entryWidth 20 \
listVar fromPopDown noTyping [namespace current]::listing \
state normal \
anchor nw \
validate real \
text '0' \
textvariable variablePicked \
selectionFunc {tk_messageBox -message 'Changed !!!!'}];
pack $entry2 -side top -anchor nw;
I was in HW GUI ToolKit some function as selectionFunc but It doesn't work ! May somebody have any ideas ?
Thank you a lot for your help
Answers
-
Hi,
Could you explain your requirement in detail?
Regards
Rahul R
0 -
Hello Rahul R,
Thank you for your help ! So here is my example interface :
proc interface {} {
global listing
set myTopLevel [hwt::CreateWindow mytoplevel -windowtitle 'Window' -minsize 500 375 -post];
set recess [hwt::WindowRecess mytoplevel];
set section [LabeledFrame $recess.constructeur 'Section' -topPad 5 -bottomPad 5]
pack $section -side top -anchor nw -fill both -expand 1;
set frame1 [frame $section.frame1];
pack $frame1 -side top -anchor nw -expand 1;
hwt::AddPadding $frame1 -side left -width [hwt::DluWidth 4];
set listing [list '0' '1' '2' '3' '4'];
set entry2 [hwt::AddEntry $frame1.entry1 \
label 'Make a choice :' \
labelWidth 30 \
entryWidth 20 \
listVar fromPopDown noTyping [namespace current]::listing \
state normal \
anchor nw \
validate real \
text '0' \
textvariable Piece \
listProc messageBox];
pack $entry2 -side top -anchor nw;
}
proc messageBox {} {
tk_messageBox -message 'Changing !!!!'
}
interfaceSo with this code sample, I would like to launch a message box as soon as my value in my textbox changed.
But as far as i have is only when I click my box.
Do you any idea to solve this ?
0 -
Hi,
You can do it by using tcl tracer
trace add variable Piece write messageBox
rewrite messageBox procedure with optional arguments
0 -
Ok thank you but because I'm a beginner, could you tell me how to do it ?
Thanks a lot for your help
0 -
0