Hi,

I can reproduce this bug - I then did a little digging, and realised it's
not a bug:)

If you use the method SetSel instead of Select, you should see that it
works. Apparently this is the selection method you should use when the
listbox is in multiple select mode - this is a windows feature (!?) not a
win32::gui feature.

Cheers,

jez.


----- Original Message ----- 
From: "Frazier, Joe Jr" <[EMAIL PROTECTED]>
To: <perl-win32-gui-users@lists.sourceforge.net>
Sent: Saturday, July 03, 2004 3:27 PM
Subject: RE: [perl-win32-gui-users] AxWindow not receiving certain
keystrokes


I am having trouble selecting items in a ListBox.  Basically, when using
the latest Dev version of Win32::GUI, I can only get the select to work
when multisel is set to 0.  The problem is that I need to be able to
select multiple items during program load as defaulting to being
selected.  Any help would be appreciated.  This is for Perl 5.6 v
0.0.671 Dev from Laurent Rocher site.  Please let me know if I am doing
something wrong or if it is broke.


use Win32::GUI;
my $Window = new Win32::GUI::Window (
-name   => "Window",
-topmost => 1,
-left   => 300,
-dialogui => 1,
-top    => 400,
-width  => 222,
-height => 300,
-text   => "Test",

-events =>
{

Terminate => sub {   return -1 },
},
);


$Window->AddListbox(
-name =>"List",
-height => 100,
-width =>70,
-top =>1,
-left =>5,
-multisel => 1, # Select works when this is commented out i.e.,
multisel =>0
);
$Window->List->Add("Test1");
$Window->List->Add("Test2");
$Window->List->Add("Test3");

$Window->List->Select(1);  # also tried SelectString
#$Window->List->Select(2);

$Window->Enable();
$Window->Show();
Win32::GUI::Dialog;

Joe Frazier, Jr.


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users


Reply via email to