From: Steve L. <ste...@sc...> - 2006-04-29 21:42:27
|
Hi Glenn That works a treat... The docs talk about sorting using nodes, so it never even crossed my mind to sort the entire treeview object. Many thanks Steve Glenn Munroe wrote: > Hello Steve, > > Does this work for you? > > ================================== > > #!perl -w > > use strict; > use Win32::GUI; > > my $obMW = new Win32::GUI::Window( > -name => "mw", > -text => "TreeView", > -pos => [ 100, 100 ], > -size => [ 200, 200 ], > ); > > my $obTV = $obMW->AddTreeView( > - name => "Tree", > -pos => [ 0, 0 ], > -size => [ 190, 120 ], > -buttons => 1, > -lines => 1, > -rootlines => 1, > ); > > $obTV->InsertItem(-text => "D"); > $obTV->InsertItem(-text => "X"); > $obTV->InsertItem(-text => "A"); > $obTV->InsertItem(-text => "R"); > > $obMW->AddButton( > -name => "btSort", > -text => "Sort", > -size => [80, 24], > -pos => [60, 140], > -onClick => sub { $obTV->Sort(0); 1 }, > ); > > $obMW->Show; > Win32::GUI::Dialog(); > > > -----Original Message----- > From: per...@li... > [mailto:per...@li...] On Behalf Of > Steve Loughran > Sent: Saturday, 29 April, 2006 18:30 > To: per...@li... > Subject: [perl-win32-gui-users] Treeview -> Sort()/SortChildren() > > Hi all > > After Jason Plum posted the example code for TreeViews (thank you!), I > have had no problems at all... until today :) > > I am creating a treeview and now trying to sort the entries using Sort() > or SortChildren(), but neither of these seem to be doing anything. I > have tried using indvidual nodes within the trer. Other operations on > individual nodes in the same code loop work (like Expand() for example). > > I have tried sorting only nodes with siblings, I have tried sorting the > root node for the entire treeview, I have truied both the above with > Sort() and SortChildren(), but nothing seems to be working. > > Is it broken? Or is it me that is broken? :) > > Steve > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, > security? > Get stuff done quickly with pre-integrated technology to make your job > easier Download IBM WebSphere Application Server v.1.0.1 based on Apache > Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > http://perl-win32-gui.sourceforge.net/ > |