I've recently been looking into the *Tk packages around.
I've gone through some info on Tcl/Tk and on Gtk+
My question is what are the advantages over the Tcl/Tk
and the Gtk+....
should I learn Tcl/Tk or just go for Gtk+?
I've noticed that Tk docs haven't been updated in a couple
of years, and Gtk+ changes frequently.
Any help would be wonderful...
D
> My question is what are the advantages over the Tcl/Tk
> and the Gtk+....
They solve the same problem, but in different ways.
Gtk is a C based library, it is meant to be used by C
code. Tk is designed to work with Tcl, although it can
also be used with other scripting languages like Perl
or Python.
> should I learn Tcl/Tk or just go for Gtk+?
You should learn both. There are folks that will tell
you Tk is better, and other folks will tell you gtk is
better. You should decide for yourself.
> I've noticed that Tk docs haven't been updated in a couple
> of years, and Gtk+ changes frequently.
You are mistaken. Tk is updated quite frequently, just take a
look at the ChangeLog. Tk is much more mature than gtk so
that can account for the lack of massive changes. Also, gtk
does not really work on Windows or the Mac while Tk does.
cheers
Mo
err reply.
I like TCL.. I know Perl, Java, C, VC++, VB and many other
languages, and TCL/Tk is a welcome addition. It's easy and has a
good look to it.
I've seen Gtk+ go over to windows.. I'm not sure how easy it is
but I've seen it done. Case in point Gimp.
However, Gtk and Tk seem to have the same "Look and feel"
So I might just stay with Tk for rightnow.
Several problems I have.. maybe you can help:
1) Lack of "good" info on the net
-> If you know of any place with good info let me know
2) Look and feel
-> Do you know if the look and feel can be changed?
Thanks for all your help
D
On Wed, 28 Nov 2001 09:35:55 -0800, Mo <m...@nospam.com> wrote:
>
>They solve the same problem, but in different ways.
>Gtk is a C based library, it is meant to be used by C
>code. Tk is designed to work with Tcl, although it can
>also be used with other scripting languages like Perl
>or Python.
>
>
>You should learn both. There are folks that will tell
>you Tk is better, and other folks will tell you gtk is
>better. You should decide for yourself.
>
>
<snip>
> Several problems I have.. maybe you can help:
>
>1) Lack of "good" info on the net
> -> If you know of any place with good info let me know
>
>2) Look and feel
> -> Do you know if the look and feel can be changed?
>
>Thanks for all your help
>D
<snip>
You should be (already have??) received an automated e-mail with lots of
pointers to Tcl resources.
A good place to begin you journey would be http://www.mini.net/tcl/0.html There
are over 1600 pages of Tcl wisdom contained within. Download a pdf version here:
http://www.lucidway.org/tclwiki/pdf.html
Marty Backe
-------------------------------
mgb...@usa.net
http://www.lucidway.org
> > My question is what are the advantages over the Tcl/Tk and the
> > Gtk+....
> They solve the same problem, but in different ways. Gtk is a C
> based library, it is meant to be used by C code. Tk is designed to
> work with Tcl, although it can also be used with other scripting
> languages like Perl or Python.
Gtk was also meant to be callable from other languages - infact,
that's one of the advantages it's supposed to have over something like
Qt. There are, infact, nice Python bindings for it, as well as for
many other languages (Perl, Scheme, even some tentative Tcl ones).
--
David N. Welton
Consulting: http://www.dedasys.com/
Free Software: http://people.debian.org/~davidw/
Apache Tcl: http://tcl.apache.org/
Personal: http://www.efn.org/~davidw/
> Gtk was also meant to be callable from other languages - infact,
> that's one of the advantages it's supposed to have over something like
> Qt. There are, infact, nice Python bindings for it, as well as for
> many other languages (Perl, Scheme, even some tentative Tcl ones).
I've tried yesterday gnotcl (GTK+ binding for tcl) 0.0.7 -- it's
*working* and resembles tk very much. Wow!
--
Micro$oft Windoze, /n./: A thirty-two bit extension and graphical shell to a
sixteen bit patch to an eight bit operating system...
DB> Hello All,
DB>
DB> I've recently been looking into the *Tk packages around.
DB>
DB> I've gone through some info on Tcl/Tk and on Gtk+
DB>
DB> My question is what are the advantages over the Tcl/Tk
DB> and the Gtk+....
DB>
DB> should I learn Tcl/Tk or just go for Gtk+?
DB>
DB> I've noticed that Tk docs haven't been updated in a couple
DB> of years, and Gtk+ changes frequently.
Tcl/Tk is just older and more mature -- 90% of it has 'stablized' into a
form that most users agree on. There still are changes to Tk going on,
just not really large parts of the core. Gtk+ is much less mature --
people are still figuring out things.
Tcl/Tk and are different. Tcl is a scripting language and Tk is the GUI
package (originally) for Tcl (Tk is also available for Perl and Python).
Gtk+ is a C/C++ library.
Each has a different set of advantages and disadvantages:
Tcl/Tk Advantages:
1) As a scripting language, Tcl/Tk allows for *rapid* prototyping. No
time consuming edit-compile-link-test cycles -- one can fire up wish
(Tcl+Tk shell) and interactively try out things.
2) Instant cross-platform GUI. A GUI built with Tcl/Tk will work
out-of-the-box on MS-Windows or MacOS. Or under various flavors of
Linux or UNIX. No need to re-write or re-compile, etc.
3) Tcl is easily extendable (it is designed to be). Additional
'commands' (coded in C, C++, FORTRAN, etc.) can be added via loadable
shared libraries.
4) Tk is also easily extendable, both with additional C/C++ code and
also with 'meta widgets', coded entirely in Tcl. The behavior of
existing widgets can be widely customized, since *any* sort of binding
can be added to any widget.
Tcl/Tk Disadvantages:
1) Slow speed. Tcl/Tk is probably a little slow. Tcl is really bad for
heavy math or any other seriously computational code. (This is not
really a problem with GUI code, which is often I/O bound, and heavy
computational code can be included as a C, C++, etc. shared library.)
2) Tcl is a 'strange' language, esp. to someone 'used' to a language
like C or C++. Not hard to learn, just different -- requires some
thought to get a handle on.
=============
Gtk+ Advantages:
1) Speed. It is a compiled library.
2) Lots of 'extra' widgets.
Gtk+ Disadvantages:
1) Hard to 'rapidly' prototype -- no interactive shell to 'play with'.
2) Not cross-platform. A Gtk+ application can only be built with a
system which has had the library ported to it. In theory any Linux or
UNIX system with X11. Not MS-Windows or MacOS, AFAIK. The program
also needs to be re-compiled for each platform.
DB>
DB> Any help would be wonderful...
DB>
DB> D
DB>
DB>
--
\/
Robert Heller ||InterNet: hel...@cs.umass.edu
http://vis-www.cs.umass.edu/~heller || hel...@deepsoft.com
http://www.deepsoft.com /\FidoNet: 1:321/153
Robert Heller schrieb:
[...]
> Tcl/Tk Disadvantages:
[...]
> 2) Tcl is a 'strange' language, esp. to someone 'used' to a language
> like C or C++. Not hard to learn, just different -- requires some
> thought to get a handle on.
I came from structured languages like C or Pascal and had no problems to
learn Tcl.
But I'm still struggling with C++...
Regards,
Ingo
--
Ingo Leschnewsky
Developer
---------------------------------------------------------------------------
IS Innovative Software AG Phone: +49-69-505030-400
Feuerbachstraße 26-32 E-Mail: ingo.les...@isg.de
60325 Frankfurt am Main WWW: http://is.ag/
GERMANY
Best regards
Ulrich
I program in 4: Java, Perl, C(C++) and Visual C++ so
I will play around with TCL.. I've been "trying" to create my own
little program.. doing binary reads and such..
thanks All!
D
Followup-To:
Note that just because a package has "Tk" in its name does not make
the package necessarily comparible...
: I've gone through some info on Tcl/Tk and on Gtk+
:
: My question is what are the advantages over the Tcl/Tk
:and the Gtk+....
Tcl/Tk programming tends, in general, to be scripting in nature,
as does Tcl/Gtk programming.
Gtk+ programming by itself will be in C or C++. Note however that
other scripting languages have bindings to both the Tk library AND the
Gtk+ library.
: should I learn Tcl/Tk or just go for Gtk+?
we could make lots of suggestions. However, the best thing for you to do
is to figure out what it is exactly you want to do with the programs that
you end up writing. Knowing Gtk+ might be a lovely project if, for instance,
you plan on living at the South Pole for the next 6 months, with little
contact with the rest of the world. There's plenty there to learn,
lots of code to read. If however you actually want to write applications,
note that besides learning Gtk+, you have to pick SOME language for
your application itself - Gtk+ is not a programming language.
Now, certainly you could dedicate massive amounts of your life to learning
to write C or C++ based GUI apps. Or you could dedicate smaller amounts
to learning any one of the several scripting languages which have bindings
for Gtk+ - I don't have a list handy, but would guess that Python, Perl,
Tcl make for good places to start.
If you don't know ANY of these languages, and need to learn how to program,
as well as how to program a GUI application, and you don't have any particular
goal other than writing GUI apps for yourself, then I recommend using
Tcl/Tk - it is a very useful minimalistic place to begin. You then have
the option of adding Gtk+ libraries at a later time if you find that you
need or want the functionality there - or you can use one of the OTHER
libraries bindings available for Tcl.
: I've noticed that Tk docs haven't been updated in a couple
:of years, and Gtk+ changes frequently.
I suspect that whereever you are noticing, that site is what hasn't been
updated - Tk docs continue to improve on a regular basis. I just was
pestering the Tcl maintenance folk about a Tcl man page fix this week.
And as far as I am aware, they jumped right in to update things right
away.
Perhaps you just need a better source for docs? Did you check out the links
at <URL: http://purl.org/tcl/wiki/> ?
--
"I know of vanishingly few people ... who choose to use ksh." "I'm a minority!"
<URL: mailto:lvi...@cas.org> <URL: http://www.purl.org/NET/lvirden/>
Even if explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.
One can create various look and feel GUI apps in Tcl by using different
GUI library bindings. However, note that because the Tcl GUI community
haven't yet developed a sort of GUI meta layer, it is likely that
one will need to develop an app against a specific look and feel, and
that changing that look and feel will require some degree - possibly
significant - amounts of program change.
See <URL: http://www.purl.org/NET/Tcl-FAQ/part5.html> for the extension
libraries of which i am aware.
Starting from scratch with GTK+ is likely to take
you a couple of *days*. That's if you already have
some level of comfort with C; otherwise, it'll be
longer.
Conclusion: try out Tk. It's essentially free, in
comparison to the amount of time you'll invest in
GTK+, and you might well find it suits you so well
you don't need the latter.
Tangent: there are reasons to prefer Tk's documen-
tation to GTK+'s. We needn't argue the point now;
just know that the decision is more ambiguous than
some zealots preach.
--
Cameron Laird <Cam...@Lairds.com>
Business: http://www.Phaseit.net
Personal: http://starbase.neosoft.com/~claird/home.html
Tk is different from what many Windows and now Linux people
expect. It's from an older tradition. In many ways, Tk
offers *more* control over appearance than is typical for
Win* applications. That's a practical advantage that many
of us enjoy. On the other hand, Tk does not (yet--but work
on it inches along) support "themes".
> Perl/Tk..
Oh yes, it has all the advantages of Tk, and the added advantage of being
unreadable.
Dave...
But it does not need fancy wrappers to obfuscate the code ;-)
This should make it ... aerm ... "commercially viable" ...
Andre', sometimes gazing at his own old perl code in wonder.
--
André Pönitz .............................................. poe...@gmx.de
David Wijnants schrieb:
> David Bates wrote:
You mean there is no need to encrypt the source?
Gruß,
>Tcl/Tk Disadvantages:
>
>1) Slow speed. Tcl/Tk is probably a little slow. [...]
> [...]
>Gtk+ Advantages:
>1) Speed. It is a compiled library.
In my experience, the opposite is true. Tk apps tend
to be a lot more responsive than GTk, Qt, and Motif
applications.
The speed-critical bits of Tk are already coded in C,
and seem to have a lot less bloat than the other toolkits.
[ Earlier ]
> Tcl is really bad for heavy math or any other seriously computational code.
I wouldn't go that far -- it's not really *good* for
serious number crunching, but on modern hardware the
performance is often acceptible. My current project
is an interactive playback utility for flight test data;
normally Tcl wouldn't have been my first choice of
implementation languages for this, but since it's running
on a GHz Pentium the ease-of-implementation benefits
outweighed the performance penalties.
--Joe English
> you can reasonably expect to sit down at a "bare"
> computer, and install, begin to use, and acquire
> a rudimentary feel for Tcl/Tk in a couple of hours.
Hereby nominated for quote of the week.
IL> Hi,
IL>
IL> Robert Heller schrieb:
IL>
IL> [...]
IL> > Tcl/Tk Disadvantages:
IL> [...]
IL> > 2) Tcl is a 'strange' language, esp. to someone 'used' to a language
IL> > like C or C++. Not hard to learn, just different -- requires some
IL> > thought to get a handle on.
IL>
IL> I came from structured languages like C or Pascal and had no problems to
IL> learn Tcl.
Tcl is like LISP -- its 'non syntax' gives some people extreme trouble,
at least at first. Some people pick it up instantly.
IL>
IL> But I'm still struggling with C++...
Yeah, C++ can have an interesting learning curve for some people.
IL>
IL> Regards,
IL> Ingo
IL>
IL>
IL> --
IL>
IL> Ingo Leschnewsky
IL> Developer
IL> ---------------------------------------------------------------------------
IL> IS Innovative Software AG Phone: +49-69-505030-400
IL> Feuerbachstraße 26-32 E-Mail: ingo.les...@isg.de
IL> 60325 Frankfurt am Main WWW: http://is.ag/
IL> GERMANY
IL>
IL> Hi David,
IL>
IL> David Wijnants schrieb:
IL> > David Bates wrote:
IL>
IL> > > Perl/Tk..
IL> > Oh yes, it has all the advantages of Tk, and the added advantage of being
IL> > unreadable.
IL>
IL> You mean there is no need to encrypt the source?
Yeah, Perl is a "write-only" type of language, like APL. Perl's syntax
can be seriously cryptic (and thus it can become unreadable, often by
the person who wrote it in the first place). :-)
IL>
IL> Gruß,
IL> Ingo
IL>
IL>
IL> --
IL>
IL> Ingo Leschnewsky
IL> Developer
IL> ---------------------------------------------------------------------------
IL> IS Innovative Software AG Phone: +49-69-505030-400
IL> Feuerbachstraße 26-32 E-Mail: ingo.les...@isg.de
IL> 60325 Frankfurt am Main WWW: http://is.ag/
IL> GERMANY
IL>
JE> Robert Heller wrote:
JE>
JE> >Tcl/Tk Disadvantages:
JE> >
JE> >1) Slow speed. Tcl/Tk is probably a little slow. [...]
JE> > [...]
JE> >Gtk+ Advantages:
JE> >1) Speed. It is a compiled library.
JE>
JE> In my experience, the opposite is true. Tk apps tend
JE> to be a lot more responsive than GTk, Qt, and Motif
JE> applications.
This is true of the base GUI stuff. If one codes *seriously*
computationally intensive stuff, then there can be speed issues.
What you cut from my message: computationally intensive stuff can be
coded in C as a shared library object.
JE>
JE> The speed-critical bits of Tk are already coded in C,
JE> and seem to have a lot less bloat than the other toolkits.
JE>
JE> [ Earlier ]
JE>
JE> > Tcl is really bad for heavy math or any other seriously computational code.
JE>
JE> I wouldn't go that far -- it's not really *good* for
JE> serious number crunching, but on modern hardware the
JE> performance is often acceptible. My current project
JE> is an interactive playback utility for flight test data;
JE> normally Tcl wouldn't have been my first choice of
JE> implementation languages for this, but since it's running
JE> on a GHz Pentium the ease-of-implementation benefits
JE> outweighed the performance penalties.
I guess I am more used to lower-end systems. *I* don't have such a fast
box at pressent (and don't really feel a need for it either). I find it
is easy enough to create mixed language projects (C/C++ for 'serious
number crunching' type code, Tcl/Tk for GUI front ends, both as shared
libraries and fork()ed CLI programs).
JE>
JE>
JE> --Joe English
JE>
JE> jeng...@flightlab.com
JE>
It seems to me that one big thing that Tcl/Tk has in its favour is that
a one-liner there is equivalent to a page or two of code in C/C++/Java
using a GUI toolkit like Motif, GTK, Qt or AWT/Swing. I suppose this
also goes some way towards explaining the relative unpopularity of GUI
designer tools in Tcl/Tk; if you can do it in less time by typing, why
bother firing up some fancy app?
> I suspect that whereever you are noticing, that site is what hasn't been
> updated - Tk docs continue to improve on a regular basis. I just was
> pestering the Tcl maintenance folk about a Tcl man page fix this week.
> And as far as I am aware, they jumped right in to update things right
> away.
:^)
(I'm keen on fixing docs, but I've not the time to do it as much as I
would like, or to go round updating random websites over the web. And
then there's the separate issue of the frequency of releases...)
Donal.
--
Donal K. Fellows http://www.cs.man.ac.uk/~fellowsd/ fell...@cs.man.ac.uk
-- "I'm going to open a new xterm. This one's pissing me off" Anon. (overheard)
> Hi David,
>
> David Wijnants schrieb:
> > David Bates wrote:
>
> > > Perl/Tk..
> > Oh yes, it has all the advantages of Tk, and the added advantage of being
> > unreadable.
>
> You mean there is no need to encrypt the source?
Not with Perl programs - they're already encrypted when they come out of the
editor.
In the sense of 'while one has access to the clear source, it is difficult
to figure out what an average (or clever) perl programmer was attempting.
l> According to David Wijnants <dwij...@askalix.com>:
l> :David Bates wrote:
l> :> Perl/Tk..
l> :Oh yes, it has all the advantages of Tk, and the added advantage of being
l> :unreadable.
l>
l> In the sense of 'while one has access to the clear source, it is difficult
l> to figure out what an average (or clever) perl programmer was attempting.
Exactly. This is a 'feature' Perl shares with APL...
l> --
l> "I know of vanishingly few people ... who choose to use ksh." "I'm a minority!"
l> <URL: mailto:lvi...@cas.org> <URL: http://www.purl.org/NET/lvirden/>
l> Even if explicitly stated to the contrary, nothing in this posting
l> should be construed as representing my employer's opinions.
l>
You know, perhaps that is the real difference. While Tcl is used in other
languages, it doesn't work as smoothly (IMO) as it does for Tcl, which it was
designed specifically for.
Gtk however was designed to be a GUI toolkit, and concessions were made so
that many languages could bind to it. It's my understanding that, with
the possible exception of gnocl, most bindings for Gtk are 'simply'
a "reflection" of the C API into the language in question. Tk under Tcl
isn't a C API with Tcl trappings, but truly an integrated part of the language.
--
"I know of vanishingly few people ... who choose to use ksh." "I'm a minority!"
<URL: mailto:lvi...@cas.org> <URL: http://www.purl.org/NET/lvirden/>
Even if explicitly stated to the contrary, nothing in this posting
Of the many good points, I want to refute this point. There really
isn't that much difference. With all the advantage of being able
rapidly prototype, the Tk GUI stuff is almost all in C. Tk is as fast
or faster than Gtk, which is the comparison asked about. Tcl will be
slower than C in all the math, true, but then you have to go through
doing all that extra coding in C as well. If you don't need serious
math, it's just dev time wasted. If you do need serious math, create
a shared library (or use JCW's CriTcl).
> 2) Lots of 'extra' widgets.
... built-in. Tk has lots of extra widgets as well, but they aren't
part of the core (though 8.4 has several new ones). There are dozens
of extra cool widgets available though (chart widgets, graph widgets,
progressbar, dials, knobs, toolbar type things, calendars, ...)
--
Jeff Hobbs The Tcl Guy
Senior Developer http://www.ActiveState.com/
Tcl Support and Productivity Solutions