Hello everyone!

I've found usefull notes on toolbar. However I have not found how to combine 
different images to get one toolbar. Later on is my code. I have three 
bitmaps: one, two and both. If you call the script as follows:

perl script.pl both

then you get two-images toolbar. But if you call 

perl script.pl whatever

then you dont get proper toolbar bitmap (Perl complains that it needs a list 
and the second addbitmap: $TB->AddBitmap($two, 2); is incorrect.

Is someone able to help me and show how to combine inline bitmaps dynamically 
in toolbar?

Regards

Waldemar


###########################################################
#!/usr/bin/perl

use strict;
use warnings;
use Win32::GUI qw();
use Win32::GUI::BitmapInline ();

my $one = new Win32::GUI::BitmapInline( q(
Qk02AwAAAAAAADYAAAAoAAAAEAAAABAAAAABABgAAAAAAAADAAATCwAAEwsAAAAAAAAAAAAA////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////AAAAAAAAAAAAAAAAAAAA
AAAA////////////////////////////////////////////////AAAAAAAA////////////////
////////////////////////////////////////AAAAAAAA////////////////////////////
////////////////////////////AAAAAAAA////////////////////////////////////////
////////////////AAAAAAAA////////////////////////////////////////////////////
////AAAAAAAA////////////////////////////////////////////////////////AAAAAAAA
////////////////////////////////////////////////////////AAAAAAAA////////////
////////////////////////////////////////////AAAAAAAA////////////////////////
////////////////////////AAAAAAAAAAAAAAAA////////////////////////////////////
////////////////////AAAAAAAA////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////
) );
my $two = new Win32::GUI::BitmapInline( q(
Qk02AwAAAAAAADYAAAAoAAAAEAAAABAAAAABABgAAAAAAAADAAATCwAAEwsAAAAAAAAAAAAA////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAA////////////////////////////////AAAAAAAA////////////////////////////
////////////////////////////////AAAAAAAA////////////////////////////////////
////////////////////////AAAAAAAAAAAA////////////////////////////////////////
////////////////////AAAAAAAA////////////////////////////////////////////////
////////////AAAAAAAA////////////////////////////////////////////////////////
////AAAAAAAA////////////////////////////////////////////////////////AAAAAAAA
////////////////////////////AAAAAAAA////////////////////AAAAAAAA////////////
////////////////AAAAAAAA////////////////AAAAAAAA////////////////////////////
////////AAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////
) );
my $both = new Win32::GUI::BitmapInline( q(
Qk02BgAAAAAAADYAAAAoAAAAIAAAABAAAAABABgAAAAAAAAGAAATCwAAEwsAAAAAAAAAAAAA////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////AAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////////////
////AAAAAAAA////////////////////////////////////////////AAAAAAAA////////////
////////////////////////////////////////////////////////AAAAAAAA////////////
////////////////////////////////////AAAAAAAA////////////////////////////////
////////////////////////////////AAAAAAAA////////////////////////////////////
////////////////AAAAAAAAAAAA////////////////////////////////////////////////
////////AAAAAAAA////////////////////////////////////////////////////////////
AAAAAAAA////////////////////////////////////////////////////AAAAAAAA////////
////////////////////////////////////////////////////////AAAAAAAA////////////
////////////////////////////////////AAAAAAAA////////////////////////////////
////////////////////////////////////AAAAAAAA////////////////////////////////
////////////AAAAAAAA////////////////////////////////////////////////////////
////////////AAAAAAAA////////////////////////////////////////////AAAAAAAA////
////////////////////////////////////AAAAAAAA////////////////////AAAAAAAA////
////////////////////////////////AAAAAAAAAAAAAAAA////////////////////////////
////////////AAAAAAAA////////////////AAAAAAAA////////////////////////////////
////////////////AAAAAAAA////////////////////////////////////////////AAAAAAAA
AAAAAAAAAAAAAAAA////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
) );

my $W = Win32::GUI::Window->new(-name=>'W',-size=>[400,400],);

my $TB = $W->AddToolbar(-name=>"Toolbar",);

$TB->SetBitmapSize(16, 16);

if (( $ARGV[0] ) && ( $ARGV[0] eq 'both' )) {
        $TB->AddBitmap($both, 1);
} else {
        $TB->AddBitmap($one, 1);
        $TB->AddBitmap($two, 2);
}

$TB->AddButtons( 2, 0,0,4,0,0, 1,1,4,0,1, );

$W->Show();
Win32::GUI::Dialog();
exit(0);

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
http://perl-win32-gui.sourceforge.net/

Reply via email to