
November 9th, 2004, 08:16 PM
|
|
Contributing User
|
|
Join Date: Jul 2004
Location: Pennsylvania
Posts: 49
Time spent in forums: 5 h 51 m 48 sec
Reputation Power: 5
|
|
|
interface of tcl/tk and perl
Hi all,
I don't know whether this is right place to ask tcl/tk question. If not can someone guide me where to put this question ?
I am trying to write a small tk GUI which could interact with my Perl code running at back ground. Perl code takes 5 arguments, input file, output file, and three variables. It is working fine with command line. I am writing the code for tk GUI, but the variables interface between GUI and perl is not working and it seems that its not taking the values from GUI. So there is some problem with the binding variables which I am trasfering to exec command.
Can someone help in fixing the code.
thanks
Code:
#!/usr/local/bin/wish -f
button .run -text RUN
pack .run -side right
label .label1 -text "I/P file name:"
label .label2 -text "O/P file name:"
entry .entry1 -width 20 -relief sunken -bd 2
set p {puts [.entry1 get]}
entry .entry2 -width 20 -relief sunken -bd 2
set q {puts [.entry2 get]}
pack .label1 .entry1 -side top -padx 1m -pady 2m
pack .label2 .entry2 -side top -padx 1m -pady 2m
frame .left
frame .middle
frame .right
foreach size {1024 2048 4096} {
radiobutton .pts$size -text "$size" -relief flat -variable pts -value $size
}
set r {puts [.pts$size get]}
foreach val {1 2 3} {
radiobutton .vol$val -text "$val" -relief flat -variable vol -value $val
}
set s {puts [.vol$val get]}
foreach tech {65 90 130} {
radiobutton .nano$tech -text "$tech" -relief flat -variable nano -value $tech
}
set t {puts [.nano$tech get]}
pack .left -side left -padx 3m -pady 3m
pack .middle -side left -padx 3m -pady 3m
pack .right -side right -padx 3m -pady 3m
pack .pts1024 .pts2048 .pts4096 -in .left -side top -anchor w
pack .vol1 .vol2 .vol3 -in .middle -side top -anchor w
pack .nano65 .nano90 .nano130 -in .right -side top -anchor w
bind .run <Button-1> {exec test2.pl $p $q $r $s $t}
|