Posted on 2009-06-16 21:35:37-07 by mkanna
Calling TK procedure from TCL not working
Hi, I have written a small TCL script that will call TK procedure which will open a widgets and has text field init. When I execute the TK procedure seperately through command line, it works fine. But when I call the TK procedure from TCL script, i dont see tk window coming up. Not sure whether I missed anything. Here is my TCL script, ************ #!/usr/bin/wish package require Tcl package require Tk package require Tclx package require Expect set env(tag_dir) "/opt" source [file join $env(tag_dir) local lib controllerAp.lib] source [file join $env(tag_dir) local lib contr_cli_cmd.lib] proc tk_CCX_DevConfig {txt} { label .l1 -text $txt button .b1 -text "Ok" -command "destroy ." grid .l1 -row 2 grid .b1 -row 4 -column 0 } ... ... # Call the above TK procedure if [catch {tk_CCX_TagConfig "Plz configure Dev"} err] { puts "Error in invoking Input Gui" } puts "User configuration is completed" ********** the expected behavior should be .. tk window should pop up with following message "Plz configure Dev". And control has to go back to main script only when 'OK' is pressed. But when i execute the above script, it popup a empty window and then control immediately goes back to main Tcl script ( it displays "User configuration is completed". Could you please let me know how to transfer the control to the tk procedure and why the message is not getting displayed in tk widgets. Thanks, Kanna
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.