I have been trying to set an icon for an MDIFrame.  I also need to set different icons for the Child windows.  I am using Win32::GUI 1.03 with Activestate 5.8.7 along with Komodo and Perlapp.  In the past, I could never get the "-icon=>$icon" to work so I had to use Win32::GUI::Class to set the window icon and that seemed to work just fine.
 
my $icon = new Win32::GUI::Icon("c:\\JS1G.ICO");
my $windowclass = new Win32::GUI::Class(-name => "mywindowclass", -icon => $icon,);
our $mainform = Win32::GUI::Window->new(
                                      -name=>'mainwindow',
                                      -text=>'Main Window',
                                      -width=>1024,
                                      -height=>768,
                                      -class=>$WC,
                                       ) or die "window creation failed: $!\n";
 
But this causes another issue when using MDIFrame and MDIChild.  Using the same technique as above with MDIFrame, I get the icon but the background of the frame window changes and I never see the Child window.
 
my $icon = new Win32::GUI::Icon("c:\\JS1G.ICO");
my $WC = new Win32::GUI::Class(-name => "mywindowclass", -icon => $icon,);

our $mainform = Win32::GUI::MDIFrame->new(
                                      -name=>'mainwindow',
                                      -text=>'Main Window',
                                      -width=>1024,
                                      -height=>768,
                                      -class=>$WC,
                                       ) or die "frame creation failed: [EMAIL PROTECTED]";

our $mainclient = $mainform->AddMDIClient(
                                         -name=>'designer_client',
                                         -firstchild=>100,
                                        ) or die "client creation failed: [EMAIL PROTECTED]";

$childwindow = $mainclient->AddMDIChild(
                                                   -name=>'window1',-text=>'Window1',
                                                   -width=>810, -height=>610,
                                                   -top=>100, -left=>100,
                                                   -dialogui=>1,
                                                   -accel=>$accelerators,
                                                   -menu=>$mainmenu,
#                                                   -class=>$WC,
                                                   -icon => $icon,
                                                  ) or die "child creation failed: [EMAIL PROTECTED]";

Using the "-class" option (commented out above) in the child window causes a gpf type failure:

Perl Command Line Interpreter has encountered a problem and needs to close. We are sorry for the inconvenience.

and the "-icon" option does nothing. 
 
I get the same behaviour using Win32::GUI 1.0 with Perl 5.6.
 
In short: How do I set one icon for an MDIFrame and different icons for MDIChild windows??
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to