Richard Faasen
2014-05-11 17:03:56 UTC
I've been trying to get Wx::TaskBarIcon to work on OS X. I got the icon
to show up in the menubar, but I can't get a popup menu to show. I
understand none of the events are working on OS X so I've created a
subclass to override CreatePopupMenu but it doesn't get called either.
Am I doing something obvious wrong? I'm using wxWidgets 2.9.4, wxPerl:
0.9922.
Here's my code.
package MyTaskBarIcon;
use base 'Wx::TaskBarIcon';
sub CreatePopupMenu {
my ($this) = @_;
say "xx"; # This never gets called
my $menu = Wx::Menu->new();
$menu->Append(-1, "menu 1");
$menu->Append(-1, "menu 2");
return $menu;
}
# Creating MyTaskBarIcon
my $trayicon = MyTaskBarIcon->new();
$trayicon->IsOk() || die;
$trayicon->SetIcon(Wx::GetWxPerlIcon(1), "Click me!");
Regards,
Richard
to show up in the menubar, but I can't get a popup menu to show. I
understand none of the events are working on OS X so I've created a
subclass to override CreatePopupMenu but it doesn't get called either.
Am I doing something obvious wrong? I'm using wxWidgets 2.9.4, wxPerl:
0.9922.
Here's my code.
package MyTaskBarIcon;
use base 'Wx::TaskBarIcon';
sub CreatePopupMenu {
my ($this) = @_;
say "xx"; # This never gets called
my $menu = Wx::Menu->new();
$menu->Append(-1, "menu 1");
$menu->Append(-1, "menu 2");
return $menu;
}
# Creating MyTaskBarIcon
my $trayicon = MyTaskBarIcon->new();
$trayicon->IsOk() || die;
$trayicon->SetIcon(Wx::GetWxPerlIcon(1), "Click me!");
Regards,
Richard