To enable tooltips you need to do something like this:
$TB->SetStyle(TBSTYLE_FLAT|TBSTYLE_TRANSPARENT|1|TBSTYLE_LIST|TBSTYLE_TOOLTIPS);
$TB->SetExtendedStyle(0x00000008);

0x00000008 is the TBSTYLE_EX_MIXEDBUTTONS style which is only compiled in if 
the constant _WIN32_IE is greater or equal to 0x0501. You can set this in 
GUI.h, and I see no reason for it to remain forced at 0x0401 as this is *OLD*, 
so I've updated it to 0x0501 as that basically means "IE 5 installed" which 
everyone in their right mind has.

CVS committed.

Steve

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] 
> Behalf Of
> Jez White
> Sent: 18 February 2004 10:03
> To: Steve Pick; Win32 GUI Hackers (E-mail)
> Subject: Re: [perl-win32-gui-hackers] CVS update: Toolbars
> 
> 
> Hi,
> 
> I've had a play and it seems ok - although I'm having a few 
> problems with
> some of the styles - but this could be me:)
> 
> The example below creates a toolbar with a few buttons (run 
> in the samples
> folder for it to pick up the bitmaps) which are added via image lists.
> If I use the SetStyle method (with any style) the toolbar 
> ends up at the
> bottem of the window. I've yet to get any functionality working with
> SetExtendedStyle (I was trying to get tooltips working with 
> the toolbar
> using the text from the buttons).
> 
> Just me?
> 
> Cheers,
> 
> jez.
> ==============
> 
> use Win32::GUI;
> 
> $W = new Win32::GUI::Window(
>     -title    => "Win32::GUI::Toolbar test",
>     -left     => 100,
>     -top      => 100,
>     -width    => 500,
>     -height   => 400,
>     -name     => "Window",
> );
> 
> $B1 = new Win32::GUI::Bitmap("one.bmp");
> $B2 = new Win32::GUI::Bitmap("two.bmp");
> $B3 = new Win32::GUI::Bitmap("three.bmp");
> $IL = new Win32::GUI::ImageList(16, 16, 0, 3, 10);
> $IL->Add($B1, 0);
> $IL->Add($B2, 0);
> $IL->Add($B3, 0);
> 
> $TB = $W->AddToolbar(
>     -left   =>  0,
>     -top    =>  0,
>     -width  => 300,
>     -height => 100,
>     -name   => "Toolbar",
>     -addstyle =>  0x0800,
> );
> $TB->SetImageList($IL);
> #$TB->SetStyle(TBSTYLE_FLAT|TBSTYLE_TRANSPARENT);
> #$TB->SetExtendedStyle(TBSTYLE_EX_MIXEDBUTTONS|TBSTYLE_EX_DRAW
> DDARROWS);
> $Bh1 = new Win32::GUI::Bitmap("three.bmp");
> $Bh2 = new Win32::GUI::Bitmap("one.bmp");
> $Bh3 = new Win32::GUI::Bitmap("two.bmp");
> $ILhot = new Win32::GUI::ImageList(16, 16, 0, 3, 10);
> $ILhot->Add($Bh1, 0);
> $ILhot->Add($Bh2, 0);
> $ILhot->Add($Bh3, 0);
> $TB->SetHotImageList($ILhot);
> $TB->AddButtons(
>     4,
>     0, 1, 4, 0, 0,
>     1, 2, 4, 0, 1,
>     0, 0, 0, TBSTYLE_SEP, 0,
>     2, 3, 4, 0, 2,
> );
> $TB->AddString("One");
> $TB->AddString("Two");
> $TB->AddString("Three");
> 
> $W->Show;
> 
> Win32::GUI::Dialog();
> 
> 
> sub Window_Terminate {
>     return -1;
> }
> 
> sub Window_Resize {
>     $TB->Resize($W->ScaleWidth-10, 100);
> }
> 
> sub Toolbar_ButtonClick {
>     my($button) = @_;
>     print "Toolbar: clicked button $button\n";
> }
> 
> 
> 
> -------------------------------------------------------
> SF.Net is sponsored by: Speed Start Your Linux Apps Now.
> Build and deploy apps & Web services for Linux with
> a free DVD software kit from IBM. Click Now!
> http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
> _______________________________________________
> Perl-Win32-GUI-Hackers mailing list
> Perl-Win32-GUI-Hackers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-hackers
> 

Reply via email to