Hello. I'm trying to get the text, column, and item index on a right click in a Wx::ListCtrl. The item index works perfectly. However, I can't seem to get any other information. Here's a very abbreviated idea of what I am doing:

  package MyList;
  use base qw(Wx::ListCtrl);

  ...
  sub new {
    my $self = shift;
    my $params = shift;

    $self = $self->SUPER::new(
      $params->{'parent'},
      -1,
      wxDefaultPosition,
      [ 600, 400 ],
      wxLC_REPORT|wxLC_VIRTUAL|wxLC_HRULES,
    );

  ...
    EVT_LIST_ITEM_RIGHT_CLICK(
      $self, $self,
      sub {
        my ($self, $event) = @_;
        my $item = $event->GetItem();
        my $index = $event->GetIndex();
        my $text = $event->GetText();
        my $col = $item->GetColumn();
        my $data = $item->GetData();
        my $text2 = $item->GetText();

        print "Item index $index => '$text' ($col, $data, $text2)\n";
    });

  return $self;
  }

This prints, for example:

  Item index 19 => '' (0, 0, )

What am I doing wrong, if anything? Thanks in advance.
--
Dave Hayes - Consultant - Altadena CA, USA - d...@jetcafe.org
>>>> *The opinions expressed above are entirely my own* <<<<

Sometimes what a person escapes to is worse than what they
escaped from.

Reply via email to