G'day James,

++ It worked as described for me.

There's an unlimited amount of times that "next" can be used. You may want to add a limit. At the moment, for the first several uses, the proportions are retained; something like this:

+-----+
|     |
|     |
|  O  |
|     |
|  O  |
|     |
|     |
+-----+

After half a dozen uses, the layout degrades; very roughly like this:

+-----+  +-----+  +-----+  +-----+
|     |  |     |  |     |  |     |
|     |  |     |  |     |  |     |
|  O  |  |  O  |  |  O  |  |  O  |
|     |  |     |  |     |  |     |
|  O  |  |  O  |  |  O  |  +-----+
|     |  |     |  +-----+
|     |  +-----+
+-----+

As a general rule-of-thumb in Tk applications, unless I want to pass an absolute value to a callback which doesn't change that value, I use references. In many cases, even if the value isn't being changed in the callback, it may be changed prior to the callback being invoked; references are typically a good option in these cases also.

You also may want add a "prev" button to test down-scaling.

Not intended as a huge criticism, but I do see the following code repeated:

$canvas->createPolygon(@scaledBox, -fill => 'darkgreen'); $canvas->createOval(@scaledTopColon, -fill => 'yellow'); $canvas->createOval(@scaledBotColon, -fill => 'yellow');

Consider abstracting that into a single routine. If you subsequently want to change something, you'll only need to do it in one place (see "DRY principle").

— Ken


In reply to Re: Tk::LCD Investigations by kcott
in thread Tk::LCD Investigations by jmlynesjr

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.