Yes, this is one way of going about fixing it - I have also suggested doing something like:

my $mode = $cw->cget('-validate') || "none";

To ensure that there was a value. The thing is it should never have been left to default to undef like it had. I think my preferred fix would be to set a default from the very start ... say at line 207:

-validate => [qw/METHOD validate Validate none/],

It's worth mentioning that the newer versions of JComboBox don't have this problem. The newer version also has features that look like they would have helped folks who have posted here before.

This is probably the first time I've ever checked perlmonks for problems encountered with JComboBox -- I find it a little odd that the questions weren't posted to comp.lang.perl.tk, but I'm glad that folks were able to get help with it, or find better solutions.

Rob

In reply to Re^6: Help with JComboBox by rcseege
in thread Help with JComboBox by ChrisR

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.