|
From: Erick J. B. <er...@e-...> - 2001-02-14 23:21:47
|
Jeremy, sorry what I gave was a typo, I did indeed have
$Index[0] (Cutting and pasting error :) ). It should look
like this:
$MainWin->AddListView(
-name => "ListView",
-pos => [85, 100],
-size =>
[$MainWin->ScaleWidth-160,$MainWin->ScaleHeight-170],
-style => WS_CHILD | WS_VISIBLE | 1
|WS_HSCROLL | WS_VSCROLL,
-fullrowselect => -1,
-gridlines => 0,
-hottrack => 0,
-visible => 0,
-view => 1,
-tabstop => 4,
-singlesel => 1,
);
$width = $MainWin->ListView->ScaleWidth;
$MainWin->ListView->InsertColumn(
-index => 0,
-subitem => 0,
-width => $width-15,
-text => "Column",
);
for (sort keys %SomeHash) {
$MainWin->ListView->InsertItem(-text=>[$_]);
}
$MainWin->AddButton(
-name => "Button",
-text => "&Ok",
-pos => [347, 350],
-height => 20,
);
sub Button_Click {
my @index = $MainWin->ListView->SelectedItems();
if ($index[0] >= 0) { #I need the zero because of the
zero-based index
#do something...
} else {
Win32::MsgBox(...);
}
Any more ideas are more than welcome.
erick
never stop questioning
www.jeb.ca
----- Original Message -----
From: Jeremy Blonde <sco...@ya...>
To: <per...@li...>
Sent: Wednesday, February 14, 2001 11:04 PM
Subject: Re: [perl-win32-gui-users] SelectedItems method
> Well, I don't know if this will actually fix your
> problem, but you should definitely be using
> "$index[0]" instead of "@index[0]".
>
> Just my 2 cents,
> jb
>
|