How can I develop Tk applications with MyTcl?

3 views
Skip to first unread message

johann...@googlemail.com

unread,
Oct 16, 2018, 5:01:30 PM10/16/18
to mytcl
Hi!

I'm interested in learning Tk, so I can use Python and tkinter to build some GUI tools.  :-)
However, the "real" documentation for Tk is in Tcl, so I decided to learn some Tcl/Tk to better understand Tk.

I also found your MyTcl IDE.
It's really helpful. Good stuff!  :-)

In MyTcl, I can write and debug Tcl programs that use the console (printing some output text, reading some input text, ...).
This works fine.

However, In don't know how to run a Tk program from MyTcl.
For example, I have a file Script01.tcl in a project in MyTcl which contains the following code:

package require Tk
label .hello -text "Hello World"
pack .hello
puts "End"

If I set a breakpoint at 'puts "End"' and debug the file in MyTcl, I don't get an error, but I also don't get a Tk window.

If I run this file with wish, for example:
C:\ActiveTcl\bin>.\wish.exe c:\Project002\Script01.tcl
then I get a Tk window.

Maybe you can give me a five line example script that displays a Tk window when executed from MyTcl.

Thanks for your help.

Regards
Johannes

Reply all
Reply to author
Forward
0 new messages