Madhan
Madhan

Reputation: 1321

How to change perl win32::GUI window title bar image?

While developing desktop applications using Perl Win32::GUI module in windows OS, a "camel" image is present in the title bar (left most image on window).
Is it possible to change that one? If yes, what kind of image will support(.gif,.png,.jpg,.ico) for this? and which property I need to change/add in the design window that I have written below?

  use strict;
  use Win32::GUI;

  my $main = Win32::GUI::Window->new(
    -name    => "Main",
    -title   => "Win32-GUI:Test",
    -left    => 100,
    -top     => 100,
    -width   => 600,
    -height  => 400,
  );

  sub Main_Terminate() {
    print "Main window terminated\n";
    return -1;
  }


  $main->Show();

 Win32::GUI::Dialog();

Note: I am developing the application in windows XP

Upvotes: 1

Views: 1225

Answers (1)

bvr
bvr

Reputation: 9697

Yes, it is possible. Use SetIcon method of the main window.

$main->SetIcon($icon);

where $icon have to be instance of either Win32::Icon, Win32::Bitmap or Win32::BitmapInline.

Upvotes: 2

Related Questions