http://qs1969.pair.com?node_id=1219968

Sandy has asked for the wisdom of the Perl Monks concerning the following question:

I am currently scouring the web to find tutorials on using perl Tcl/Tk that would help me translate my pure perl Perl/Tk Custom Widgets.

Too many choices, but never sure what Tcl/Tk book focuses on Tk more than on Tcl.

Any recommendations would be greatly appreciated.

Thx, Sandy

Replies are listed 'Best First'.
Re: Tutorials for custom widgets in Tcl/Tk
by kcott (Archbishop) on Aug 07, 2018 at 10:17 UTC

    G'day Sandy,

    I take it you currently have Tk widgets you've written yourself and you want to translate them into something else; however, I don't really know what you mean by "perl Tcl/Tk". Perhaps Tcl::Tk, Tkx, or similar?

    It's also unclear whether you're looking for online tutorials or books to buy.

    Anyway, if you could clarify those points, it would help. In the meantime, here's a few suggestions.

    • I've never used Tcl::Tk; but I see from its doco, discussions of both "Perl/Tk" and "Tcl/Tk": maybe something useful there. I also noted in its MANIFEST what appears to be the same filenames (tk-demos/*) as Tk's widget demo: a comparison of the two might help.
    • I have used Tkx so, if that's what you're using, I may be able to provide more direct help. Its doco has links to tutorials. One in particular, TkDocs - Tk Tutorial, shows code for creating the same widgets using Perl, Tcl, Ruby and Python: again, a comparison may be fruitful.
    • ActiveState ActiveTcl provides a lot of documentation; although not too much in the way of Tk tutorials (as far as I can see). I did find this useful when I was first getting to grips with Tkx.

    — Ken

      Sorry if I was not clear

      I want to migrate to Tcl::Tk

      Yes, I have lots of custom widgets in Tk (Perl/Tk) that I want to migrate to Tcl::Tk

      I have looked at books online, but it is hard to tell if they are focussing more on Tcl than Tk. I don't want to spend oodles of money only to have a book that does not describe how to make custom widgets.

      Online tutorials are fine too... I just want to learn it.

      Apparently Tcl::Tk allows you to write pure Tcl code, which would allow me to create a custom widget in pure Tcl, translating would be a pain, but I will do it if I have to. But I still need to know how.

      Thx, Sandy

Re: Tutorials for custom widgets in Tcl/Tk
by Tux (Canon) on Aug 07, 2018 at 06:45 UTC

    Of course this is a personal opinion, but please skip Learning Perl/Tk and use Mastering Perl/Tk instead. This first is (IMHO) useless, the second is a nice refence book.


    Enjoy, Have FUN! H.Merijn
      Ah, I have read, digested, reread Mastering Perl/Tk many times

      But, it looks awful on MAC, and not so great on windows, so I want to update to Tcl/Tk.

      Problem is, I have lots of custom widgets which I don't know how to port.

        If you think perl/Tk looks awful (you're allowed to think so, I know more people that do, but it still is an opinion), tcl/Tk won't change a thing! It will look just as ugly (or beautiful) as perl/Tk. It is all Tk in the end.

        If your perception of nice/beautiful is that it should match the native window styles, and zillion of people will agree with you that that is what they expect, than you should change to Wx. Be prepared to a whole lot of work in rewriting your code. The pro of Wx is that your portable App will look native on all platforms. The con of Wx (compared to Tk) is that you need a lot more code and that the App does not look the same in every environment.

        It may be obvious that I prefer Tk, but I also understand that people say it shows its age.


        Enjoy, Have FUN! H.Merijn
Re: Tutorials for custom widgets in Tcl/Tk (Tcl::pTk)
by Anonymous Monk on Aug 10, 2018 at 11:00 UTC
    Use Tcl::pTk and see if youre done translating ;)