Popup (context) menu behavior is strange
- From: Steve Fox <drfickle k-lug org>
- To: gtk-perl list <gtk-perl-list gnome org>
- Subject: Popup (context) menu behavior is strange
- Date: 18 Jan 2003 23:54:35 -0600
I've got a CTree for which I have context menu attached to right click
events. It works perfectly fine, except that you must hold the mouse
button down in order to select second or later menu items. If you simply
right click and release, it selects the first menu item immediately
rather than just displaying the menu.
Anyone have a suggestion on how to fix this? I noticed that
Stephen Wilhelm's tutorial exhibits similar behavior with the 'menu'
example application.
Here's the relevant code:
sub _prepare_buddy_menu {
my $self = shift;
my $menu = $self->{_window}->{buddy_menu} = new Gtk::Menu;
$menu->set_tearoff_state(0);
my @items =
(
["Chat" => sub { $self->connect_buddy() }],
["Edit" => sub { $self->edit_buddy() } ],
["Remove" => sub { $self->_remove_buddy_dialog() } ],
["Info" => sub { $self->_buddy_info_dialog() } ],
);
foreach my $rec (@items) {
my ($name, $callback) = @{$rec};
my $menu_item = Gtk::MenuItem->new($name);
$menu_item->signal_connect('activate', $self->$callback);
$menu->append($menu_item);
$menu_item->show();
}
}
Thanks.
--
Steve Fox
http://k-lug.org
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]