The NLUG Penguin

Northants Linux Users Group

NLUG
  • Home
  • Aims
  • Projects
  • Reviews
  • People
  • Library
  • Disclaimer
Meetings
  • Next Main
  • Interim
  • On-line
  • Dates
  • Notes
Joining
  • How to join
  • EMail Lists
  • Support
  • Wiki
Links
  • Linux Links
  • Sponsors
  • Vendors
  • Contacts

Mastering Perl/Tk

Steve Lidie and Nancy Walsh
1st January 2002
Publisher : O'Reilly
ISBN: 1-56592-716-8

Reviewer : Kevin Taylor
Review Date : 14th February 2002

Initial Thoughts

This book is based on 'Learning Perl/Tk' (also by Nancy Walsh) but with many additions - hence the name change. This new book is probably the definative work on Perl/Tk.

First chapter

This introduces the basic concepts and history of Perl/Tk, (including why), and compares it to GUI programming in C. It introduces the basic conventions used (describing widgets and options, etc) plus a short discussion about Perl/Tk for Win32.

We are then into the obligatory 'Hello World' example, followed by a discussion of 'main' windows, 'toplevel' and event logs.

Finally, there is a description of the naming conventions for widgets, followed by some notes about debugging and prototyping.

2 - Geometry Management

One of the key 'basic' chapters - fully discusses geometry management. A good chapter with lots of screenshots to illustrate the basic ideas.

Discussions always start with the basics, moving on to talk about advanced features. The book is very up-to-date, including the newer 'form' management too.

3 - Fonts

Fonts are introduced in this chapter. The core discussion centres around the X notation for specifying fonts, with a note that this also works on Win32.

I found this chapter quite hard to read - I was left still being unsure about exactly how to use fonts. I suspect that actually coding up and running the examples will help.

Much of the confusion probably comes from not knowing which fonts are available on a platform until you try the scripts.

4-12 - Basic Widgets

Chapters 4 to 12 cover the core Tk widgets in great detail. This is the remaining bulk of the original 'Learning Perl/Tk' book.

The 'Button' chapter is the most comprehensive, as it introduces many of the ideas that are common to all widgets.

Each chapter is a full discussion of each widget, including some quite advanced features - an example is the 'extended' text widget features, which the book claims are not documented any where else other than in this book!

Sometimes there are platform specific notes (Win32 or Unix). It would be clearer if there was a small icon that represented the platform, which may be inserted in the text, to enable easy spotting of these notes.

There is a lot of information here and maybe it would have been easier on the reader to have each chapter contain a 'basics' and 'advanced' part for each widget. However, this is definately a comprehensive description of the facilities (I had not heard of 'pie menus' before).

13 - Misc Perl/Tk Methods

This is the final discussion about widgets, including common methods used by most widgets. Much of this is for the advanced user, but covers things like configure/get, clipboard, focus, colours, etc.

14 - Custom Widgets

This is the start of the 'expert' chapters and covers composite and derived widgets. This is a good chapter. Much of what is included was the province of 'gurus' before - the information being scattered around, by 'word of mouth' or just in source code.

This covers everything you need to know to get you going, including packaging up for CPAN and ActiveStates 'ppm'.

15 - Anatomy of Main Loop

Covers in detail everything about interacting with the Main loop, including the use of callbacks, events, etc.

16 - User Customisation

Describes how to give the user full customisation of your application. Much of this is X specific, but ported over to Win32. Again a clearer indication of which parts are X and which are Win32 would be useful.

17 - Images

This covers the 'magic' associated with using images. Again, this collects together the information from many diverse sources, into a single place.

18 - Tk Extensions

This introduces the additional 'Tix' widgets. I was surprised to find no mention of the 'notepad' widget though ... but can't remember if this is a Tix widget or not ...

19-20 - IPC

19 covers inter-process communications using a network, by working through an example. 20 talks about the Tk specific 'send' (Unix only). These are Tk 'detail' chapters - it may have been useful to have a 'pre-amble' section about writing multi-threading, GUI apps first, to 'set the context'.

21 - C Widget Internals

All about implementing a widget in C. Includes details of building and interfacing to Perl/Tk.

22 - Perl/Tk and the Web

This is more a description of GUI applications that can use the web via perl modules (ie more a discussion of the LWP module really ...).

Next it talks about PerlPlus - a plugin for Netscape to run Perl/Tk code, embedded in a web page.

I would have preferred to see a discussion about how to display/use HTML (and XML?) marked up text in a text widget. This is mentioned, but not really covered, in chapter 8.

23 - pTk Potpourri

This is a roundup chapter covering things not included elsewhere. Also includes a discription of many composite widgets (including the missing 'notebook' widget :)

Appendices

These contain reference info for installing Perl/Tk, lists of widget options and listing to all the scripts.

Summary

There is a lot of information in this book. Even if you already own 'Learning Perl/Tk' there is a lot of new stuff - although the newer stuff is primarily aimed at the advanced user.

My only critisism is that the book definately has a 'Unix' feel (hardly surprising given its subject matter). It would have been nice to know how Win32 differs, in a more obvious way in the text ... This would allow me to write my Perl/Tk scripts on Linux and know that my colleagues would still be able to use them on their Win32 systems with no problems.

Kevin
14th February


Please read our disclaimer before using the services of the group.
Feel free to Get in touch
Campaign for a non-browser-specific WWW
Use any browser