Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

tk_optionMenu output to file

Status
Not open for further replies.

Manjun

Technical User
Mar 16, 2003
1
US
Hi,
I'm new to tcl/tk and I've started learning this language which I will be using it for my future project. I've been trying to output a file that involves entry field and tk_optionMenu field but I get a error saying use "cget or configure". Could some one guide me how to use cget or configure option in this situation.
Another question, How do I insert a same code multiple rows with the row number and column number increased or decreased.
Thanks a lot.
- Manjunatha

my code:
set de .default
frame $de
pack $de -side left

tk_optionMenu $de.metal w2 "M1 M2 M3 M4 M5"
entry $de.width -width 6 -relief sunken

grid $de.metal -row 0 -column 0
grid $de.width -row 0 -column 1

proc write {} {
set o1 [$de.metal get]
set o2 [$de.width get]
set file [open ./testing.txt]
puts $file "Metal is \"$o1\" and the Width is \"$o2\" "
close $file
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top