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?
http://perl-win32-gui.sourceforge.net/cgi-bin/docs.cgi
http://www.mail-archive.com/perl-win32-gui-users@lists.sourceforge.net/msg00945.html
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.