Hi,
here a sample (modified hello.pl from wxPerl) that demonstrate the error
when I try to use HitTest with right mouse button. Just klick the right
mouse button over any tab.
Also, I looked at the source (Notebook.xs), there is something odd, that
might explain it. As I understand it, there is line 84 "#if
WXPERL_W_VERSION_LE( 2, 5, 1 )" and the HitTest is only compiled when
"#if WXPERL_W_VERSION_GE( 2, 5, 2 )" at line 129. Seems to me that this
cant work (maybe a #endif is missing before line 129 ???).
Cheers,
Andre
Code:
use strict;
use Wx;
package MyApp;
use vars qw(@ISA);
@ISA = qw(Wx::App);
sub OnInit {
my( $this ) = shift;
my( $frame ) = MyFrame->new();
$this->SetTopWindow( $frame );
$frame->Show( 1 );
}
package MyFrame;
use vars qw(@ISA);
@ISA = qw(Wx::Frame);
use Wx::Event qw(EVT_RIGHT_DOWN);
use Wx qw(wxDefaultPosition);
sub new {
my( $this ) = shift->SUPER::new( undef, -1, 'Hello, world!',
wxDefaultPosition , [350, 100] );
$this->SetIcon( Wx::GetWxPerlIcon() );
$this->{NoteBook} = Wx::Notebook->new($this, Wx::NewId());
$this->{NoteBook}->AddPage(Wx::Panel->new($this->{NoteBook}), "Page1", 1);
$this->{NoteBook}->AddPage(Wx::Panel->new($this->{NoteBook}), "Page2", 1);
EVT_RIGHT_DOWN($this->{NoteBook}, sub {
my ($that, $hEvent) = @_;
my $wMouseX = $hEvent->GetX();
my $wMouseY = $hEvent->GetY();
$this->{NoteBook}->HitTest([$wMouseX,$wMouseY]);
} );
return $this;
}
package main;
my( $app ) = MyApp->new();
$app->MainLoop();
|