Ok, understood. If I change items to:

my $menuitem = [ [command => 'Open', -image => $compound], [comman +d => 'close'] ];

Then the left edge of the ? lines up with the left edge of close - that is, there is only as much space to the left of either entry as I would expect. Indeed, if I add an edit menu with two plain entries:

$menuitem = [ [command => 'Open'], [command => 'close'] ]; $menubar->cascade(-label => 'Edit', -tearoff => 0, -menuitems => $ +menuitem);

I see the same amount of space to the left of the entries there.

However, I can see your issue - the space to the left is excessive and other programs are capable of putting an icon there. Problem understood. :) No answer yet, but I'll look into it later tonight if you haven't an answer before then.


DWIM is Perl's answer to Gödel

In reply to Re^3: Placement of image with Tk::Compound and Tk::Menu by GrandFather
in thread Placement of image with Tk::Compound and Tk::Menu by ldln

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.