|Think about Loose Coupling|
Quick and Dirty Perl/Tk GUIby aplonis (Pilgrim)
|on Jan 11, 2007 at 23:23 UTC||Need Help??|
I sometimes need a quick and dirty Tk GUI for some off-hand project. Having gotten tired of writting anew or doing without a GUI, I cobbled together a package for banging them out quick an dirty. Once I got started I also realized that I similarly tire of writing validity-checking routines. So I wed the two tiresome chores together. I call it Easy GUI for lack of a better imagination.
It only does two things: A) Create columns of label/entry widgets; B) Create rows of button widgets. But this is not so limiting as you might think.
ENTRY: Entry widgets may contain paths, strings, integers, reals or lists, all self-verifying. Those for paths are auto-supplied with browse buttons.
BUTTON: Button widgets may be single- or double-click (toggle) type. Toggle-buttons may have two actions.
CHECKING: You can do all of the following:
Optionally, you can further impose that:
Configuration is brain-dead simple. All you do is flag what's to go in each entry by a text string so that the validity routines know how to check them.
Here's a link to both my Tk-EasyGUI.pm module and my complete, stand-alone, example script. I've tested them on WinXP and NetBSD 2.0.2. The license is our dear, old Perl artistic license. So do with it whatever you wish. Included therein is also ample documentation, POD sufficient to serve even the rankest Perl newbie.
PS - I'm uncertain whether this module is ready for or even worthy of uploading to CPAN. Besides the original development-use-only script, I have since employed it in a few other places. All those are linked to in the documentation page. Kindly inform me whether you find it useful or a needless frill. Thanks.