From: Robert M. <rob...@us...> - 2008-01-27 16:25:29
|
On 26/08/2007, Robert May <rob...@us...> wrote: > On 22/08/07, Waldemar Biernacki <wb...@sa...> 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. |