logoalt Hacker News

vincent-manisyesterday at 11:52 PM5 repliesview on HN

I use Tk routinely in Scheme; there is no Tcl in my code, but Tk is a very nice (though basic) GUI kit, and my programs work on Linux, BSD, MacOS, and Windows. Other commenters have mentioned that Python ships with Tkinter, a library module that interfaces to Tk. I believe Ruby does the same. Hell, if you're programming in Cobol, you can have Tk (as long as your Cobol allows you to call C). You do not have to love Tcl to love Tcl/Tk.


Replies

kevin_thibedeautoday at 5:02 AM

> interfaces to Tk

It interfaces to its own internal Tcl interpreter that runs Tk. You can even feed it arbitrary non-Tk commands to eval.

This is a legacy of the trouble Perl/Tk had splitting it out as an independent library which the Tcl devs didn't want to support.

ofalkaedtoday at 12:52 AM

>you can have Tk (as long as your Cobol allows you to call C).

No C required, you can just connect to the UI through a socket and often skip the FFI completely. This is my preferred way to use Tk and I don't even consider anything else unless there is a reason. Working this way also has the nice side effect of making the application UI agnostic.

show 2 replies
forintitoday at 12:55 AM

When I first found out about Tcl/Tk, it was used to give a GUI to programs written in C. I've used Tk with Tcl and many times with Perl too.

em-beeyesterday at 11:55 PM

in what way is Tk basic? can you elaborate? also what are your thoughts on the issues with python as mentioned in the article? how do the scheme bindings compare?

piloto_ciegotoday at 12:22 AM

This is a fun idea! Are you using Guile-tk?