Hello...
Experiencing the pitfalls of working with a module that is still in beta, and that the author hasn't finished documenting yet. In Win32::GUI, I am trying to create a toolbar, with 5 buttons, each of which should have a picture on it. I am using the toolbar.pl sample script that comes with Win32::GUI as a guideline, but I don't see many differences aside from the number of buttons I'm adding, (5) as opposed to what the sample script adds. (3)
So what I'm wondering is...does anyone know proper syntax/arguments for getting a bitmap onto a button? The documentation for Toolbars is not there, and only one bitmap method is described for Bitmap objects. The rest are TBD. I'm using the following code:
$main_toolbar = $main->AddToolbar(
-left => 0,
-top => 0,
-width => $main->ScaleWidth-10,
-height => 16,
-name => "Toolbar"
);
my $tb_bmp = Win32::GUI::Bitmap->new("c:\\devel\\adtserver_new\\toolba
+r16.bmp");
$main_toolbar->SetBitmapSize(16,16);
$main_toolbar->AddBitmap($tb_bmp, 5);
$main_toolbar->AddButtons(
5,
0, 1, 4, 0, 0,
1, 2, 4, 0, 1,
2, 3, 4, 0, 2,
3, 4, 4, 0, 3,
4, 5, 4, 0, 4
);
I get the toolbar and the buttons, but they are blank, and henceforth not very useful. [; Also, any further help on what the args for AddButtons are used for would help immensely. I know the first arg is the number of buttons to add, and the 2nd column in each group of five is the number that's returned for the Click event. Everything else....*shrug* Anyone know what's up?
HaB
hword.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.