Home > Archive > Tcl > October 2006 > Pls recommend Tcl/Tk program
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Pls recommend Tcl/Tk program
|
|
|
| Hi all,
I am a Tcl learner and want to read some Tcl/Tk program. Please
recommend some programs or resource about 1000 lines (I prefer Tk based
GUI program). Thanks!
Thanks,
Davy
| |
| Googie 2006-09-26, 8:40 am |
| Davy wrote:
> Hi all,
>
> I am a Tcl learner and want to read some Tcl/Tk program. Please
> recommend some programs or resource about 1000 lines (I prefer Tk based
> GUI program). Thanks!
>
> Thanks,
> Davy
>
Tk demos provided with Tk should be excellent for you :)
--
Pozdrawiam! (Regards!)
Googie
| |
|
| Davy wrote:
> Hi all,
>
> I am a Tcl learner and want to read some Tcl/Tk program. Please
> recommend some programs or resource about 1000 lines (I prefer Tk based
> GUI program). Thanks!
>
Davy
I think aMSN would be a suitable candidate for study. It is a very good
substitute for MSN Messenger, although there are some features it does not,
as yet implement. Also it is very much actively supported. I haven't
looked at the code for a while and cannot remember how big it is. There
are certainly quite a few source modules involved.
A couple of additional points:
1) aMSN implements a tray icon - interesting to see how this is done.
2) aMSN is multi-platform, although the versions are somewhat different -
tray icon handling is an obvious area of difference. Downloading both the
Linux & Windows versions might be useful if this aspect was of interest
later on.
http://amsn.sourceforge.net/
BTW, I am not involved in the creation or support of aMSN, just a very happy
user :)
HTH
Rob.
| |
| Larry W. Virden 2006-09-26, 7:02 pm |
|
Davy wrote:
> I am a Tcl learner and want to read some Tcl/Tk program. Please
> recommend some programs or resource about 1000 lines (I prefer Tk based
> GUI program). Thanks!
>
What aspect of Tcl do you wish to learn? check out http://wiki.tcl.tk/
where you can find many examples of tcl code.
| |
| Helmut Giese 2006-09-26, 7:02 pm |
| On 26 Sep 2006 03:35:49 -0700, "Davy" <zhushenli@gmail.com> wrote:
>Hi all,
>
>I am a Tcl learner and want to read some Tcl/Tk program. Please
>recommend some programs or resource about 1000 lines (I prefer Tk based
>GUI program). Thanks!
Hi Davy,
go to
http://wiki.tcl.tk/RS
scroll down a bit and then start picking topics.
You're interested in GUI code? Often the title indicates whether it is
GUI oriented or not.
In general: Have a look at pages starting with 'A little ...' (a bit
further down the page) - truly amazing.
In any case: Be prepared to spend some time with _any_ of these
examples. You will be learning a lot - RS is one of the Tcl gurus.
It's amazing what he accomplishes in a couple of lines of Tcl.
Oops, I just realized that you are probably a beginner. In this case
looking at code by a true expert might be intimidating (because you
get the feeling "Hey, I don't understand any of this. Tcl must be
truly complicated.")
Don't worry, Tcl is _not_ complicated. It's only that RS uses
everything available in Tcl in very effective (and often ingenious)
ways.
So tug away the link above and go there in a couple of w s when you
will be well up on the Tcl learning curve.
Good luck - and welcome to Tcl
Helmut Giese
| |
|
|
Roy Terry wrote:
> "Davy" <zhushenli@gmail.com> wrote in message
> news:1159266949.226089.71110@h48g2000cwc.googlegroups.com...
> For better recs let us know something
> about your experience level and interests.
> For example: GUI, Sockets, controlling
> other programs, database, etc. I do second the
> idea of just browsing the Tcl/tk Wiki
> and seeing what sparks your interest.
>
[snip]
Hi all,
My experience level include C/C++, Perl and HDL(hardware language).
I am familiar with control and algorithm programming, but not familiar
with GUI and network.
And my interests are use Tcl/Tk to generate GUI and control other
programs (I think it maybe Tcl/Tk's most importance thing). Thanks!
Any suggestions are welcome!
Best regards,
Davy
[color=darkred]
> Roy
| |
| Larry W. Virden 2006-09-27, 8:01 am |
|
Sean Woods wrote:
> I picked up Tk by nabbing a copy of Brent Welch's
> "Practical Programming in Tcl/Tk."
>
> I've been programming Tcl/Tk since '97 and I still use
> that book for reference.
Yes, see if you can find the latest edition of that book - lots of
wonderful info. If you can't find it locally, try half.com or amazon or
one of the other online bookstores. If that's too expensive, check with
a local library (at school or public) and if they don't have a copy of
it, ask if they can borrow a copy from another library.
Another useful book, particularly for gui related topics, is Efficient
Tcl/Tk Programms. And Clif Flynt's latest book, I am told, is quite
good.
| |
|
|
Larry W. Virden wrote:
> Sean Woods wrote:
>
[snip]
Hi Larry,
I have brought a Brent book. Thanks!
And I have use http://perldoc.perl.org/ to learn Perl (there are some
very good tutorial on the site). Is there any Tcl/Tk site like this
Perl site, thanks!
Best regards,
Davy
[color=darkred]
>
>
>
> Yes, see if you can find the latest edition of that book - lots of
> wonderful info. If you can't find it locally, try half.com or amazon or
> one of the other online bookstores. If that's too expensive, check with
> a local library (at school or public) and if they don't have a copy of
> it, ask if they can borrow a copy from another library.
>
> Another useful book, particularly for gui related topics, is Efficient
> Tcl/Tk Programms. And Clif Flynt's latest book, I am told, is quite
> good.
| |
| Aric Bills 2006-09-27, 10:00 pm |
| Here is the "official" Tcl tutorial:
http://www.tcl.tk/man/tcl8.5/tutorial/tcltutorial.html
If you work through this, please provide some feedback about your
experience.
You also don't want to miss Bryan Oakley's Tcl Scripting website:
http://www.tclscripting.com/
Bryan is both an insightful programmer and an amazing teacher; his
tutorials will give you a solid foundation for some serious Tcl/Tk
programming.
| |
| suchenwi 2006-09-28, 8:02 am |
|
Helmut Giese schrieb:
> go to
> http://wiki.tcl.tk/RS
> scroll down a bit and then start picking topics.
> You're interested in GUI code? Often the title indicates whether it is
> GUI oriented or not.
>
> In general: Have a look at pages starting with 'A little ...' (a bit
> further down the page) - truly amazing.
>
Alternatively, I'm also bringing a wide selection of those, with
hopefully better introductory text, and lots of new content, to
http://en.wikibooks.org/wiki/Programming:Tcl
BTW, that is a Wiki too - everybody is invited to help make it better!
| |
| Cameron Laird 2006-09-28, 8:02 am |
| In article <1159416546.582588.320420@h48g2000cwc.googlegroups.com>,
Aric Bills <aric.bills@gmail.com> wrote:
>Here is the "official" Tcl tutorial:
>
> http://www.tcl.tk/man/tcl8.5/tutorial/tcltutorial.html
>
>If you work through this, please provide some feedback about your
>experience.
>
>You also don't want to miss Bryan Oakley's Tcl Scripting website:
>
> http://www.tclscripting.com/
>
>Bryan is both an insightful programmer and an amazing teacher; his
>tutorials will give you a solid foundation for some serious Tcl/Tk
>programming.
>
A. Along with Aric's apt suggestions, you'll do well
to read <URL: http://wiki.tcl.tk/1304 >.
B. Aric's admonition to "provide some feedback" is
particularly timely. The official tutorial is in
the middle of rewrite, and your comments, as an
experienced programmer new to Tcl, can be parti-
cularly valuable. You'd even be welcomed to join
in the rewrite, if you're up to that.
| |
| Roy Terry 2006-09-28, 7:02 pm |
| "Davy" <zhushenli@gmail.com> wrote in message
news:1159332839.304747.68180@h48g2000cwc.googlegroups.com...
>
> Roy Terry wrote:
based[color=darkred]
> [snip]
> Hi all,
>
> My experience level include C/C++, Perl and HDL(hardware language).
>
> I am familiar with control and algorithm programming, but not familiar
> with GUI and network.
>
> And my interests are use Tcl/Tk to generate GUI and control other
> programs (I think it maybe Tcl/Tk's most importance thing). Thanks!
>
Ok, here are a couple ideas
tkdiff.tcl - nice code but more like 10,000 lines
Beg, borrow or buy the Expect book by
the author of Expect Don Libes. In terms of
writing clarity and style it is probably the best
description of Tcl ever written. And if you
want to control other programs Expect
is the gold standard.
Other interesting bits of code might be
sockspy
and
visualre
Find all the above via google or similar.
Also wouldn't go amiss looking thru
the latests contents of tcllib from
sourceforge.
Hope that helps.
Roy
> Any suggestions are welcome!
>
> Best regards,
> Davy
>
>
| |
|
|
Cameron Laird wrote:
> In article <1159416546.582588.320420@h48g2000cwc.googlegroups.com>,
> Aric Bills <aric.bills@gmail.com> wrote:
[snip]
I agree!
Davy
[color=darkred]
>
> A. Along with Aric's apt suggestions, you'll do well
> to read <URL: http://wiki.tcl.tk/1304 >.
> B. Aric's admonition to "provide some feedback" is
> particularly timely. The official tutorial is in
> the middle of rewrite, and your comments, as an
> experienced programmer new to Tcl, can be parti-
> cularly valuable. You'd even be welcomed to join
> in the rewrite, if you're up to that.
| |
| Larry W. Virden 2006-09-29, 7:03 pm |
|
Davy wrote:
> Hi Larry,
>
> I have brought a Brent book. Thanks!
> And I have use http://perldoc.perl.org/ to learn Perl (there are some
> very good tutorial on the site). Is there any Tcl/Tk site like this
> Perl site, thanks!
http://www.tcl.tk/doc/ is one such place. Then at http://wiki.tcl.tk/ ,
if you look for tcl commands, such as http://wiki.tcl.tk/set , you will
go to a page where there is a link to the command's formatted reference
doc, as well as various comments, examples, special notes, etc. And,
being a wiki, if you go to a page and don't see what you need, you can
edit the page, ask a question, and check back a bit later to find the
answer.
| |
| Larry W. Virden 2006-09-29, 7:03 pm |
|
Davy wrote:
> I am a Tcl learner and want to read some Tcl/Tk program. Please
> recommend some programs or resource about 1000 lines (I prefer Tk based
> GUI program). Thanks!
Have you taken a look at http://wiki.tcl.tk/TclTutor ? The application
itself is something that you could example, particularly after taking
all the courses...
| |
|
|
Larry W. Virden wrote:
> Davy wrote:
>
> Have you taken a look at http://wiki.tcl.tk/TclTutor ? The application
> itself is something that you could example, particularly after taking
> all the courses...
[snip]
Hi Larry,
Yes, I have used TclTutor. But It seems have not Tk tutorial. And does
it open source? Thanks!
Best regards,
Davy
| |
|
|
| Donal K. Fellows 2006-09-30, 7:04 pm |
| Davy wrote:
> Yes, I have used TclTutor. But It seems have not Tk tutorial. And does
> it open source? Thanks!
If someone wants to write some lessons to introduce Tk, we'd *love* to
add them to the tutorial. As a suggestion, the first Tk lesson should be
a simple "hello world button" script with explanation.
(On the license front, the tutorial is open, but we need to nail down
what the license really is. If you think "compatible with Tcl's license
at least in spirit" you probably won't be far wrong.)
Donal.
| |
|
|
suchenwi wrote:
> Davy schrieb:
>
> Hmm.. if you settle with "50 lines or less", there are:
> - A minimal doodler explained (13 loc), http://mini.net/tcl/9625
> - A minimal editor explained (26 loc), http://mini.net/tcl/9623
> - A little calculator, http://mini.net/tcl/1270
> - A little webserver at http://mini.net/tcl/playing%20cgi
> - A little IRC client, http://mini.net/tcl/picoirc%200.2
> ...
[snip]
Hi,
Thanks a lot!
When I read the wiki.tcl.tk artical, I found the author like to use:
if 0 {... ...}
What's it mean?
And when I read http://mini.net/tcl/9625, just have stupid question
Why some parameter use %W, what's % mean?
And is ::_id have paticular meanings?
Best regards,
Davy
| |
| Jeff Godfrey 2006-10-01, 7:05 pm |
|
"Davy" <zhushenli@gmail.com> wrote in message
news:1159717216.828466.156910@k70g2000cwa.googlegroups.com...
> When I read the wiki.tcl.tk artical, I found the author like to use:
> if 0 {... ...}
> What's it mean?
Hi Davy,
That's just an easy way to provide a "comment" within a Tcl code body.
Since "if 0" will never be true, the content between the "{" and "}"
will never be executed by the tcl parse. So, this makes it easy for
you to just cut/paste the code from the wiki, without having to clean
it up any large blocks of comment text first.
Jeff
| |
| suchenwi 2006-10-01, 7:05 pm |
| Davy schrieb:
> When I read the wiki.tcl.tk artical, I found the author like to use:
> if 0 {... ...}
> What's it mean?
That's a "block comment", so I can annotate the code in multiple lines.
The content of the {...} is not parsed by Tcl except for brace balance.
Hasd I used #... comments, I would not have been able to use Wiki line
wrapping.
> And when I read http://mini.net/tcl/9625, just have stupid question
> Why some parameter use %W, what's % mean?
> And is ::_id have paticular meanings?
:: marks the global namespace, so ::_id means "the variable _id in the
global namespace".
| |
| Bryan Oakley 2006-10-01, 7:05 pm |
| Davy wrote:
>
> When I read the wiki.tcl.tk artical, I found the author like to use:
> if 0 {... ...}
> What's it mean?
>
It's a convenient method for inserting a block of text without it being
executed. It is, in effect, a block comment. The only catch is there
can't be unbalanced curly braces inside the block.
> And when I read http://mini.net/tcl/9625, just have stupid question
> Why some parameter use %W, what's % mean?
Those are used in bindings. If you read the man page you'll see that %W
is replaced with the widget name, %x and %y are the x/y coordinates of
the mouse pointer, etc. These are documented on the bind man page.
http://www.tcl.tk/man/tcl8.4/TkCmd/bind.htm#M24
> And is ::_id have paticular meanings?
In general? No. :: coerces the variable to be evaluated as a global
variable, but the underscore and the name "id" or "_id" have no special
significance.
--
Bryan Oakley
http://www.tclscripting.com
| |
|
|
Jeff Godfrey wrote:
> "Davy" <zhushenli@gmail.com> wrote in message
> news:1159717216.828466.156910@k70g2000cwa.googlegroups.com...
>
> Hi Davy,
>
> That's just an easy way to provide a "comment" within a Tcl code body.
> Since "if 0" will never be true, the content between the "{" and "}"
> will never be executed by the tcl parse. So, this makes it easy for
> you to just cut/paste the code from the wiki, without having to clean
> it up any large blocks of comment text first.
>
> Jeff
[snip]
Hi,
Thanks a lot! All of you are so kind!
And is there any free Tcl/Tk learning or conference presentation videos
available on the web? Thanks!
Best regards,
Davy
|
|
|
|
|