That was a good clue, Andrew, and I've done some more analysis.

Indeed, if I throw in some $mw -> Show (), and some Win32::GUI::DoEvents ()  
into my initialization routines, I get some extra interesting data.  I'm not 
sure yet what all it means,
or why it happens.  Here's my added knowledge:

Indeed, the menu shows up when initially created.  Then I add a bunch of 
widgets, and it takes more space than my initial size.  So I Resize and Move 
the window.  This seems to work
fine.  Then I Hide and Disable the window, do lots of other setup 
(theoretically, none of it applies to the main window, but an alternate window 
gets fully initialized, displayed
briefly, and then Hide and Disable.  Then, eventually, back to the main window, 
and we Enable and Show it, and when we do, in the next of my debug Show calls, 
the menu doesn't get
redrawn--the area where the menu should be is left with the desktop displayed 
there.  That's kind of like a hole in the window.  Then, because I'm afraid 
some user might have adjusted
the toolbars to cover part of my window, I recheck that, to potentially change 
the postition.  So I go through the motions of a Resize and Move again, and on 
the next Show after the
Resize, the hole where the menu should have been gets filled in with the stuff 
that should be below the menu... i.e. that stuff gets "moved up", apparently 
because the menu is now
gone.

The real question is, Where, oh where did my menu go?  Oh where, oh where can 
it be?

I guess I'll be debugging by removing code until I can make the behavior 
disappear, if I can.  Any clues would be appreciated.

Andrew Kincaid wrote:

> Using your exact code on a Windows 95B and a Windows 98SE machine running 
> Activestate Perl v.5.6.1.626 and Win32::GUI 0.0.558, I added the following 
> lines to the end of your code:
>
> $W = new Win32::GUI::Window(
>     -title    => "Title Here",
>     -left     => 100,
>     -top      => 100,
>     -width    => 400,
>     -height   => 400,
>     -style    => WS_OVERLAPPEDWINDOW,
>     -menu     => $mmenu,
>     -name     => "Window",
> );
> $W->Show();
> Win32::GUI::Dialog();
>
> and it ran fine.  I also used -menu => $smenu and it worked fine as well.  
> I'm not sure what to say unless you want to send more or all of your code.
>
> Andrew Kincaid
> Lead PC Systems Specialist, IS&T
> Georgia State University
> [EMAIL PROTECTED]
>
> >>> [EMAIL PROTECTED] 06/19/01 09:07PM >>>
> Hi,
>
> Is there a difference between Win 9x and NT for putting a menu on a
> window using Win32::GUI?
>
> I added a bunch of menus to my application, and they show up fine on NT,
> but they don't appear at all on Win 98.  In fact, at first they caused
> perl to crash on Win 98... but upgrading to build 626 seems to have
> cured the bad memory reference, but the menus don't appear.
>
> Curiously, the floating menu that I added to my NotifyIcon does appear
> on Win98.
>
> Here's my menu definition, in case there is something obviously wrong
> with it....
>
>   my $mmenu = new Win32::GUI::Menu (
>     "&File" => "FileMenu",
>     ">New &Location" => "NewLoc",
>     ">New &ISP" => "NewISP",
>     ">New &Phone Number" => "NewNum",
>     ">-" => 0,
>     ">E&xit" => "ExitNow",
>     "&Edit" => "EditMenu",
>     ">Edit Selected &Location" => "EditLoc",
>     ">Edit Selected &ISP" => "EditISP",
>     ">Edit Selected &Phone Number" => "EditNum",
>     "&Options" => "OptMenu",
>     "&Dialing" => "DialMenu",
>     ">&Dial" => "DialNow",
>     ">&Hangup" => "HangupNow",
>     ">&Launch Email" => "LaunchNow",
>     "&Help" => "HelpMenu",
>     ">&Help Text" => "HelpNow",
>     ">&About" => "AboutNow",
>     ">-" => 0,
>     ">Show &Debug Window" => "DebugNow",
>     );
>
>   $smenu = new Win32::GUI::Menu (
>     "&Dialing" => "sDialMenu",
>     ">&Dial" => "sDialNow",
>     ">&Hangup" => "sHangupNow",
>     ">&Launch Email" => "sLaunchNow",
>     ">-" => 0,
>     ">&Bring to Front" => "sForeground",
>     );
>
> --
> Glenn
> =====
> Due to the current economic situation, the light at the
> end of the tunnel will be turned off until further notice.
>
> _______________________________________________
> Perl-Win32-GUI-Users mailing list
> Perl-Win32-GUI-Users@lists.sourceforge.net
> http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
>
> _______________________________________________
> Perl-Win32-GUI-Users mailing list
> Perl-Win32-GUI-Users@lists.sourceforge.net
> http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users

--
Glenn
=====
Due to the current economic situation, the light at the
end of the tunnel will be turned off until further notice.



Reply via email to