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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing TK in linux ?? 1

Status
Not open for further replies.

yaronb

Programmer
Jan 6, 2001
13
IL
Hi,
I'm learning Tcl/Tk and wants to work on LINUX (redhat 7.0)

How can I write in Tk ? each time I'm trying to write a command from the TK library (such as "frame","button") in the tcl shell, I'm getting an error ...

Can any one help ??

Thanx...
 
post your code... and give a more detailed explaination
that way we can understand the problem better .
 
here is a simple code that creates a list and a button:

proc about {w prog args} {
if {[winfo exist $w]==1} {
switch -- [wm state $w] {
normal {
raise $w
}
withdrawn -
iconified {
wm deiconify $w
}
}
} else {
toplevel $w
wm title $w "About $prog"
set mainFrame [frame $w.names]
if {$args==""} {
set args {"not available"}
}
foreach item $args {
label $mainFrame.$item -text $item
pack $mainFrame.$item
}
set secondaryFrame [frame $w.bottom]
button $secondaryFrame.close -text Close -command "wm withdraw $w"
pack $secondaryFrame.close

pack $mainFrame -side top
pack $secondaryFrame -side bottom
}
}
about .ourName Mefagrim aaa bbb ccc

It runns under windows - BUT - "invalid commands" in linux...
(I'm running it under the tcl program...)

Can you help ?
 
Make sure you execute your script with the "wish" interpreter, not the "tclsh" (sometimes aliases just to "tcl") interpreter. tclsh understands only Tcl commands; wish supports Tcl plus the Tk extension for building GUIs. - Ken Jones, President
Avia Training and Consulting
866-TCL-HELP (866-825-4357) US Toll free
415-643-8692 Voice
415-643-8697 Fax
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top