The listview.pl that is included as a sample does the same thing I mentioned.  All I 
have to do is hover my mouse
pointer over an item and it acts like it has been clicked.

Here is the code that constructs my listview:

$MainWindow->AddListView(
 -name   => "DataView",
 -top    => $MainWindow->ScaleHeight,
 -left   => 0,
 -width  => $MainWindow->ScaleWidth,
 -height => $MainWindow->ScaleHeight - 215,
 -fullrowselect=> 1,
 -multisel=> 0,
 -gridlines=> 1,
 -hottrack=> 1,
 -style => 1,
 -visible=> 0,
);

$MainWindow->DataView->InsertColumn(
 -name   => "Col1",
 -index => 0,
 -width  => 95,
 -text   => "First Name",
);

$MainWindow->DataView->InsertColumn(
 -name => "Col2",
 -index => 1,
 -subitem=> 1,
 -width  => 95,
 -text   => "Last Name",
);

$MainWindow->DataView->InsertColumn(
 -name   => "Col3",
 -index => 2,
 -subitem=> 1,
 -width  => 100,
 -text   => "Building",
);

$MainWindow->DataView->InsertColumn(
 -name => "Col4",
 -index => 3,
 -subitem=> 1,
 -width  => 55,
 -text   => "Room",
);

$MainWindow->DataView->InsertColumn(
 -name   => "Col5",
 -index => 4,
 -subitem=> 1,
 -width  => 114,
 -text   => "Adapter Address",
);

$MainWindow->DataView->InsertColumn(
 -name   => "Col6",
 -index => 5,
 -subitem=> 1,
 -width  => 117,
 -text   => "IP Address",
);


and here is the code for the event:

sub DataView_ItemClick {
   my ($item) = @_;

   print "Item: \n",$item,"\n\n";

      %item = $MainWindow->DataView->ItemInfo( $item, 0);
      $col1 = $item{-text};
      %item = $MainWindow->DataView->ItemInfo( $item, 1 );
      $col2 = $item{-text};
      %item = $MainWindow->DataView->ItemInfo( $item, 2 );
      $col3 = $item{-text};
      %item = $MainWindow->DataView->ItemInfo( $item, 3);
      $col4 = $item{-text};
      %item = $MainWindow->DataView->ItemInfo( $item, 4 );
      $col5 = $item{-text};
      %item = $MainWindow->DataView->ItemInfo( $item, 5 );
      $col6 = $item{-text};

      print "This is: $col1 $col2 $col3 $col4 $col5 $col6\n\n";
   return;

}


Is there a double-click event for the listview?

Jonathan


----- Original Message -----
From: "Aldo Calpini" <[EMAIL PROTECTED]>
To: "Jonathan Southwick" <[EMAIL PROTECTED]>
Sent: Wednesday, October 25, 2000 11:57 AM
Subject: Re: [perl-win32-gui] ItemInfo Click event


> Jonathan Southwick wrote:
> > Is there any way to distinguish between hovering the mouse over
> > a particular item in a ListView and actually clicking on
> > the item?  Or is there a double-click event for the ListView?
> >
> > I  use an ItemClick event in my program and it reads a click
> > when the mouse hovers over any item.
>
> no idea. it does not do it on the provided listview.pl sample.
> can you post at least the ListView creation code snippet?
>
>
> cheers,
> Aldo
>
> __END__
> $_=q,just perl,,s, , another ,,s,$, hacker,,print;
>
>
>
>

Reply via email to