I will second {NULE} - for just starting out, this code looks good. Especially the use of warnings and strict. And to top it off, I found a solution to one of my problems by reviewing your code.

As {NULE} mentions, you need to apply the background to each menu item. The issue with the tear-off and the separator bar are actually two different things. The tear-off item can be fixed by using the 'setPalette' option on the main window, like this:

$main->setPalette('cyan');

This does more than just set the color - it supposedly changes the entire color palette so border shadowing and other such things appear correctly, although I haven't seen much impact on other widgets.

The separator bar issue is actually under the windowing system's (i.e., Windows, KDE, Gnome) control. If, for example, you go change the underlying display control (in Windows go to the 'Appearance' tab in the 'Display Properties' group - accessed via a right-click on the desktop) this will affect the window's borders along with the separator bar. Like {NULE}, I haven't found a way to override that behavior.


Good luck. And if you do solve the separator bar problem, please share it with us.


Pat

In reply to Re: Simple Tk question. by BlueBlazerRegular
in thread Simple Tk question: colour of drop-down menu by DigitalKitty

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.