What a coincidence - I was looking at exactly the same thing less than 24 hours ago.

I managed to change the cursor initially with:

my $priority = 40; ... $mw->optionAdd(q{*cursor}, q{left_ptr}, $priority);

However, as soon as I clicked on either the menubar or a menu button, the cursor reverted to what it was prior to using optionAdd.

Just for completeness, I also tried (and got the same result) with the more specific:

$mw->optionAdd(q{*Menu.cursor}, q{left_ptr}, $priority);

Setting $priority as high as 100 had no discernible effect either.

In the source code (for Menu.pm), I found a binding:

$mw->bind($class,'<ButtonPress>','ButtonDown');

I'm fairly sure this is causing the behaviour that we're both seeing.

I suspect overriding this binding will resolve the issue, though I've not had a chance to try this yet.

There may be other related issues in Menubar.pm, Menubutton.pm and Menu/Item.pm.

-- Ken


In reply to Re: Perl::Tk and cursor in Menubutton by kcott
in thread Perl::Tk and cursor in Menubutton by Khariton

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.