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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.