Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Quick and Dirty Perl/Tk GUI

by aplonis (Pilgrim)
on Jan 11, 2007 at 23:23 UTC ( [id://594264]=CUFP: print w/replies, xml ) 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:

  • Match strings to a RegEx.
  • Limit the range of integers and real numbers.
  • Limit resolution of reals.
  • Pose the above two limits on lists of either.

Optionally, you can further impose that:

  • None pass through if any should fail.
  • All roll back if any should fail.

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.

Fullly Documented Here

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.

Replies are listed 'Best First'.
Re: Quick and Dirty Perl/Tk GUI
by chanio (Priest) on Feb 04, 2007 at 06:07 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: CUFP [id://594264]
Approved by muba
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-04-19 17:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found