Tcl/tk?


#1

Hey are any of you guys using Tcl/Tk ? I’m using it to write scripts GUI and widgets for Gaints Nuance. I need documentation ans reference.

Cheers
Horse!


#2

Yeah how do I query a window command and exceptable arguments and then kill that window, perferably in a conditional statment.

CHEERS


#3

when I started with TCL I had the book “Practical Programming in TCL and TK”, it’s a thick black book (looks almost like a brick :)), it will definitly be a good reference and documentation. Did a search for it at amazon and I think its this one (nowadays white):

Practical Programming in Tcl and Tk (4th Edition)
http://www.amazon.com/exec/obidos/tg/detail/-/0130385603/qid=1102575699/sr=8-3/ref=pd_csp_3/002-9479365-3179226?v=glance&s=books&n=507846

It’s great if you want to know all about TCL and TK! Unfortunately I switched to Python some years ago so I never really became a “master” of the language.

Also, take a look at, http://tcl.sourceforge.net

Best,

-mk-


#4

Tcl is EVIL!! But if you have to use it Graphical Applications with Tcl & TK
by Eric Foster-Johnson
is pretty good.

How I wish Slim used Perl or python… even MEL is a bastardised version of Tcl… but that’s another rant entirely!

Simon


#5

wELL FOUND OUT how to do it and thanks for the heads up on the books. I’m going to have to get them. Thanks for the links too. I found it pretty amazing the difference in opinion on this scripting language, from evil to great.

set myWindow {[toplevel .top.fr.b1]}

if {[winfo exists $myWindow]} {
catch {destroy $myWindow}
}


#6

The book that stands in my shelf in the office is “Tcl/Tk for real programmers” (gotta love the title), which has helped me tip my toes in it. I’m fairly fluent in C/C++ and Python, and I found this book very helpful as it’s written with an audience in mind that already knows how to program.


#7

How do I add into a variable ? eg. set a [ toplevel .main], I want to add through out my code( as I build my window heirarchy )to this variable $a instead of stating the whole hiearchy .main. frame .button blah blah blah?


#8

I’m not familiar with TCL in the environment you are talking about, but to build up variables we usually use the “append” command. If we are treating the data in question as a list, then we use “lappend”.

Pearl Gecko


#9

If you’ve not really started using tcl/tk, then can I suggest that you look into python and fltk (or python and wxPython)…


#10

Would something like this work?

set a {.main}
append $a {.frame}

Append lerts you add things onto a variable. But my Tcl is limited (mainly to MTOR and nothing more!)

Simon


#11

For the append command, leave off the $.

set a {.main}
append a {.frame}

Another way to do it would be:

set a {.main}
set a “$a.frame”

The append command, however, is preferable because it is more efficient.

Hope this is helpful.

Pearl Gecko


#12

arghh! That’s one of the (smaller) reasons I don’t like Tcl! Use a $ or don’t use it - none of this somewhere in between!

Anyway thanks for the correction :wink:

Simon


#13

Thanks guy!
Tcl and Tk seem to be quite temperamantal with diffrent versions and applications eg. wiindows manager …/.


#14

>How I wish Slim used Perl or python…

you don’t say… though Perl is just as evil as Tcl.


#15

Ah but Perl is evil in a good way :wink:

Simon


#16

Ok , with that said and done which module eg. windows manager( WM ), Xscript , Wish and etc…do you find best for creating your GUI ? I need a tool set that is compatible with Tcl v7.6 and Tk v4.2 because of the software I’m trying to write the GUIs’ for.


#17

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.