On 26/08/2007, Robert May <[EMAIL PROTECTED]> wrote:
> On 22/08/07, Waldemar Biernacki <[EMAIL PROTECTED]> wrote:
> > 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?
>
> Sorry, I don't have time to look at this properly, but it looks to me
> like the code for AddBitmap() is broken - I don't think it should be
> croak()ing if the toolbar already has an imagelist as it should just
> add to the end of the list ...

OK, I've investigated forther, and made a change to
Win32::GUI::Toolbar::AddBitmap(), so that it can be called multiple
times to add bitmaps to the toolbar internal image list.

You can now replace the relavent part of you code with:

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

And both paths have the same result.

This fix should make it into the next (1.06) release.

Regards,
Rob.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
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