Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I don't think so, blessing a hash doesn't create a handle (windows does that), it just gives you an object you can call methods on

Which is why I don't understand why it's relevant. How does it help my solve the problem?

OTOH, the code you have posted includes no bless anywhere :)

Fair enough:

#!perl use Win32::GUI; &Main(); exit 0; sub Main { my $Menu = Win32::GUI::MakeMenu( '&Program' => 'Program', ' > &Alpha' => { -name => 'Alpha', -onClick => \&Alpha_Select +}, ' > &Beta' => { -name => 'Beta', -onClick => \&Beta_Select }, ); my $WinMain = Win32::GUI::Window->new( -name => 'Main', -menu => $Menu, -text => 'Menu Test', -width => 300, -height => 200, -onTerminate => \&Main_Terminate, ); $WinMain->Show(); Win32::GUI::Dialog(); } sub Main_Terminate { -1; } sub Alpha_Select { 1; } sub Beta_Select { my($Window)=@_; my $menuhandle=$Window->GetMenu(); my $menu = bless { -handle => $menuhandle }, 'Win32::GUI::Menu'; $menu->{'Beta'}->Enabled(0); # Doesn't work. return 1; }
You know, I could, or you could just read the link I posted :)

You posted a link to the tutorial. As I explained, I've already read the tutorial. I read it AGAIN after you posted the link, and yet AGAIN just now. I've read it three times in the last hour and still -- I don't see anything that's relevant to the problem, so again, can you please point out specifically what it is in the tutorial that's going to help me solve my problem?

Also, where are you getting your information from?

In reply to Re^4: How to get a window's menu as a Win32::GUI::Menu object? by shadrack
in thread How to get a window's menu as a Win32::GUI::Menu object? by shadrack

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others surveying the Monastery: (10)
    As of 2018-06-19 15:15 GMT
    Find Nodes?
      Voting Booth?
      Should cpanminus be part of the standard Perl release?

      Results (114 votes). Check out past polls.