#!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; }