Aldo, I found a bug in the properties for ListBoxes. The -sort property
must follow the -style property (if the style property is used) or else
sorting won't work. I am using AddString() now like you suggested instead
of InsertItem().
# sorting won't work
$List1 = $W->AddListbox(-name => "List1",
-sort => 1,
-style => WS_VISIBLE | WS_VSCROLL | 1 | WS_TABSTOP,
-left => 22,
-top => 48,
-height => 228,
-width => 280);
# sorting works
$List1 = $W->AddListbox(-name => "List1",
-style => WS_VISIBLE | WS_VSCROLL | 1 | WS_TABSTOP,
-sort => 1,
-left => 22,
-top => 48,
-height => 228,
-width => 280);
Regards,
Eric Hansen
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Aldo "dada"
Calpini
Sent: Monday, December 06, 1999 8:09 AM
To: [EMAIL PROTECTED]
Subject: Re: [perl-win32-gui] Request for Continous Sorting in Dual
Listbox Interfaces
Eric C. Hansen wrote:
> Aldo, can the -sort property be enhanced in a future Win32::GUI release to
> continually keep the listbox items sorted as some items are removed and
then
> added back? How does Visual Basic do this, or does it do this?
sorry, the functionality is there, I just missed to specify how it works.
for an item to be automatically added in correct sort order, you must use
the Add() or AddString() method. if you use InsertItem() instead, the
string is appended at the end of the list and no sort is done.
the docs will be corrected, thanks for pointing it out!
cheers,
Aldo
__END__
# Aldo Calpini
%_ = split undef, join ' ', qw(fahokem
xritajbugne csuctawer jhdtlrnpqloevkshpr
); print map $_{$_}, sort keys %_;