Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Win32::GUI vs Tk

by r.joseph (Hermit)
on Apr 12, 2001 at 05:01 UTC ( #71914=perlquestion: print w/replies, xml ) Need Help??
r.joseph has asked for the wisdom of the Perl Monks concerning the following question:

I don't know exactly if I should post this is SOPW or Meditations, but I will post it here for now.

My question isn't really a question, but more of a request for opinion. I have just begun getting (back) into Win32 programming with Perl, and I just recently found out about the Win32::GUI module. I have a small amount of experience with Tk in Win32 and can't say that I enjoyed it all that much.

What I would like to know is: what do my fellow monks recommend for use in Win32? What are the reasons for your recommendation (speed, ease of use, documentation)? What experience do people have with using one or the other, or maybe using one and then swtiching to the other for certain reasons?

I am not worried about portability, so don't worry about addressing that. However, I am anxious and greatful to hear whatever anyone thinks on this subject.

Thanks a bunch!

r. j o s e p h
"Violence is a last resort of the incompetent" - Salvor Hardin, Foundation by Issac Asimov

Replies are listed 'Best First'.
Re: Win32::GUI vs Tk
by Chmrr (Vicar) on Apr 12, 2001 at 06:22 UTC

    I've done a fair amount of work with Tk under Windows in the past. When a new project came up, I decided to re-evaluate this Win32::Gui that I'd heard about.

    My bout with Win32::Gui was short and painful. I found it severely under-documented -- whereas Tk has many, many pages of POD detailing every function, parameter, and copious examples -- not to mention a book on the subject -- Win32::Gui has less than minimal documentation. The examples use features which are labelled (TBD) in the docs.

    Thus, I would say that the learning curve for Win32::Gui is rather steep. You'll also probably find more people out there who are aquainted with Tk than Win32::Gui. I can't really comment on speed -- but I would imagine that Win32::Gui might have a slight edge in that category. Unfortunatly, I never got to the point where that was an issue.

    Hope this helps.

    Update: I was unaware of the existance of the mailing list that dvergin points out below. As he says, this might make Win32::Gui a little more palatable.

    perl -e 'print "I love $^X$\"$]!$/"#$&V"+@( NO CARRIER'

      I'm working with Tk under Linux as well as Win32, and while not always easy, I found it a better option than Win32::GUI. Why?
      • Like Chmrr says the documentation: What I did with Win32::GUI was hardly documented.
      • Stability. The things I tried in Win32::GUI were very unstable and crashed more often than Windows itself ;-)
      • Tk is portable. I run the same code on Win32 as on Linux. With NO change. There's not even a single command I have to keep in mind that does work on one, and doesn't work on another platform.
      But of course there are a few advantages of Win32::GUI too:
      • Real Win32 gui elements. Tk comes from the X-environments and the look and feel is not 100% Win32...With Win32::GUI you're accessing the real Windows-controls
      • If you're familiar with windows-programming at all (like in VC(++) or VB), it is probably easier to use Win32::GUI in Perl.

      Just my $0.02...

      Jouke Visser, Perl 'Adept'

        My two reasons for using Tk:

        • Canvases - make drawing very easy and interactive graphics a doddle
        • Text - the text widget is easy to use and powerful, it's also been extended by various people

        Kevin O'Rourke
Re: Win32::GUI vs Tk
by strredwolf (Chaplain) on Apr 12, 2001 at 05:19 UTC
    Besides portability... and from a Windows via C standpoint.

    Speed: There's a bit more setup with a direct Win32 interface than with TK. Also, Windows doesn't manage the windows, letting the program do it; TK helps you in that regard.

    Ease of use: Tk you can design dynamically with eaze. Windows? Painful.

    Documentation: Two CD's and a few books for Windows, not all of them from Microsoft. Tk? The manpages and "Tcl and the Tk toolkit", but there's also a Perl/Tk book.

    It's much better to use Tk than to sink more money into Win32::GUI. You'll be glad you did.


Re: Win32::GUI vs Tk
by dvergin (Monsignor) on Apr 12, 2001 at 08:10 UTC
    FWIW: Helping somewhat to address the documentation problem with Win32::GUI is the perl-win32-gui mailing list that can be subscribed to here.
Re: Win32::GUI vs Tk
by gregor42 (Parson) on Apr 12, 2001 at 17:08 UTC

    I have been working with this recently, so I'm very glad to share my experiences. For what they are worth.

    Personally, I had some frustration getting Tk working with IndigoPerl, but no problems whatsoever with ActiveState. Win32 worked fine with either. (Though IMHO it's more likely it was my fault than anything else, to be sure.)

    As far as working with them... I can only add to the voices here in expressing a distinct preference for Tk. Since neither is supported on Macintosh, there is no real cross-platform GUI support anyway. However, you can at least have the opportunity to share your work with the rest of the community & help Save The World by writing PERL code. :-}

    Plus, if you look at the Big Picture you'd realize that a Tk module for the Mac platform would be forthcoming a lot faster than say a Win32 module. :-\

    Though, you did say that compatability wasn't an issue, I simply suggest it's something that you look at from both sides. With a greater audience comes a greater amount of shared code resources. You'll find more examples & help in the long run using Tk because of compatability.

    Also, as noted previously, it doesn't crash as much! 8-P

    Wait! This isn't a Parachute, this is a Backpack!
Re: Win32::GUI vs Tk
by idnopheq (Chaplain) on Apr 12, 2001 at 17:56 UTC
    The only thing I can add is that it is easier to say 'Tk' than 'win thirty-two gooey', IMHO, although saying 'gooey' is more fun!

    Seriously, the lack of documentation for and inflexibility of Win32::GUI versus Tk consitute considerable consternation (note the fine use of alliteration). The AS mail lists can help, but the vast quantity of support in the Perl community for Tk makes it an obvious choice.

    One could improve the Win32::GUI docs and become the foremost expert on the module, improving status for oneself and providing a valuable resource to the community at large.

    Apply yourself to new problems without preparation, develop confidence in your ability to to meet situations as they arrise.

Re: Win32::GUI vs Tk
by jmcnamara (Monsignor) on Apr 12, 2001 at 20:14 UTC

    When I had to choose I preferred the look and feel of Win32::GUI but the documentation concerns raised in the other posts are valid. This is not to detract from Aldo's work. A Perl wrapper for the win32 API is a Herculean task to undertake.

    On a related note: over a year ago I wrote a Perl program to convert Delphi/C++Builder Forms to Win32::GUI templates. This allows you to use Delphi or C++Builder to design Win32::GUI clients.

    I am not upgrading or maintaining this anymore but if anyone is interested in using it or extending it they can find it here. It could probably be modified to support TK so that there was Yet Another Client Designer. ;-)


      I have two comments on this.

      Though I'm mostly a Linux developer, I've had to code
      for Windows as well. The times I've been required
      to code something that didn't need to be cross-platform,
      the moment is was not cross platform it then needed to be.

      i.e., if it could be Win-specific and I wrote it that way,
      suddenly "Cross-Platform" was the new requirement.

      That being said, I have also used Win32::GUI and did not
      have a good time with it. Even on my Windows-specific
      tasks I resort to using Tk. Ease of use and
      documentation are my reasons.

      Regarding doumentation, I found that Perl in a Nutshell
      provided enough info to start with Perl/Tk.
      Advanced Perl Programming finished off the topic,
      so when I finally got around to reading the Perl/Tk book
      I didn't learn very much. Still a good book though.

Re: Win32::GUI vs Tk
by coolmichael (Deacon) on Apr 12, 2001 at 14:08 UTC
    Largish amounts of alchol involved, sorry.

    I have read most of the perl/tk book, and found it quite informative. it taught me a great deal about idiomatic perl that i didn't find in other books.

    I haven't used Win32::GUI but I can tell you that Tk was easy and good for me.

    gosh, i hope you don't mind the rum that i've been drinking tonight.

    the blue haired monk

Re: Win32::GUI vs Tk
by larryk (Friar) on Apr 13, 2001 at 13:42 UTC
    Not having used Tk I can't comment on that side but after much fiddling with Win32::GUI I have written a few scripts using it. I liked it. The lack of documentation was part of the fun (although it has got substantially fuller since I started using GUI).

    I found that quick setting up and building of simple(ish) windows was pretty quick with Win32::GUI - even for a relatively new Perl programmer (9mths) so I wouldn't hesitate to recommend it for simple tasks.

    Since everyone is raving about Tk I'm going to have to take a look!


Re: Win32::GUI vs Tk
by spacewarp (Pilgrim) on Apr 14, 2001 at 02:02 UTC
    Having now played with Tk for about 18 hours straight, I'd have to agree that it is, indeed, wonderful. The only real beef I have with it is the lack of error messages.

    I've found that, even when using -w, if I have an error in my options or code, often the program will execute, but give no errors and no window. I'd be interested to know if anyone else has experienced this lack of feedback, as it makes de-bugging significantly more difficult.


    Use of this advanced computing technology does not imply an endorsement
    of Western industrial civilization.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://71914]
Approved by root
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2017-10-22 23:56 GMT
Find Nodes?
    Voting Booth?
    My fridge is mostly full of:

    Results (275 votes). Check out past polls.