Ok. Since you did so well helping me out with my main question, I'm hoping you can help me out with the side question I snuck into the comments of the original code.
Namely, why do the images completely fail to display when, instead of passing the image list when I create the TreeView, I try to add it later using $tv->SetImageList($il, 1); (where 1 is the value of TVSIL_NORMAL, unless I'm mistaken).
In other words, why doesn't the following work:
#!perl/bin/perl use warnings; use strict; use Win32::GUI; my $main = Win32::GUI::Window->new( -name => 'Main', -width => 300, -height => 250, ); my $il = Win32::GUI::ImageList->new(16, 16, 0x0011, 1, 1); $il->Add('FolderClosed.bmp', 'FolderClosedMask.bmp'); my $tv = $main->AddTreeView( -name => 'TreeView', -width => 280, -height => 200, -top => 10, -left => 5, -buttons => 1, -rootlines => 1, -lines => 1, #-imagelist => $il, # Instead of doing this... ); # I want to do this: $tv->SetImageList($il, 1); my $root = $tv->InsertItem( -text => 'Foo', -indent => 1, -image => 0, ); $tv->InsertItem( -text => 'Bar', -indent => 1, -image => 0, ); $tv->InsertItem( -text => 'Baz', -indent => 1, -image => 0, -parent => $root, ); $main->Show(1); Win32::GUI::Dialog(); sub Main_Terminate { return -1; }
In case you're curious why I would want to use SetImageList instead, it's because I'm actually using The GUI Loft to create the window, and don't have (easy) access to the options during creation of the TreeView. Also, I'm just curious why it's not working. :)
Anyway, thanks again for your help before, and a million thanks if you are able to help me again. :p
P.S. Welcome to the Monastery. Monk in 2 weeks, eh? You're definately doing well around here. Congrats! :D
bbfu
Black flowers blossom
Fearless on my breath
In reply to Re4: (post-create image list) Win32::GUI::TreeView and bitmap masks
by bbfu
in thread Win32::GUI::TreeView and bitmap masks
by bbfu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |