I don't use GUI creators/generators for Perl/Tk. My reasons are much the same as zentara has posted above.

I often see monolithic code that builds the entire GUI. Apart from being a poor programming technique to start with; it becomes a maintenance nightmare with anything beyond the simplest GUI. I aim for a modular approach. Here's a very rough example:

use Tk; { my $mw = Tk::MainWindow->new(); configure_main_window($mw); build_menubar($mw); build_toolbar($mw); build_main_content($mw); build_statusbar($mw); } MainLoop; sub build_main_content { my ($mw) = @_; my $main_content_frame = $mw->Frame(); build_input_widgets($main_content_frame); build_output_widgets($main_content_frame); build_action_widgets($main_content_frame); }

Once you have a basic skeleton, you can use this as a template for all your GUIs. Now you're starting to create your own automated tool.

You'll find that using this method will give all your GUIs the same look and feel. It also saves a lot of time because you don't need to write every new GUI from scratch.

If you're building many GUIs, you can write a script which further automates the process. This might be a commandline tool with options like --toolbar (a boolean switch indicating whether to include a toolbar), --title (providing the argument to $mw->title()), and so on. This tool would create the skeleton code for you based on your template.

At the end of the day, choose whatever suits your needs best. Try to temper your choice with thoughts of: maintenance, extension, debugging, and so on.

-- Ken


In reply to Re: Easier GUI by kcott
in thread Easier GUI by meirgold

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.