Re: Trouble attaching signal to items in a submenu



muppet wrote:


the "released" handler will actually get two arguments, the button and the click event; the event knows which button was pressed and when it was pressed. so, what happens if you instead use

  sub menu_show
  {
          my (undef, $event) = @_;
$menu->popup(undef, undef, undef, undef, $event->button, $event->time);
  }

?

That spits out:

*** Can't call method "button" on an undefined value at ./yarssr.pl line 148.
   ***  ignoring at ./yarssr.pl line 60.

and the menu will not popup.

I dumped @_ to see what is getting passed, and I don't see any event being passed. Here is what it lists.

   $VAR1 = bless( {}, 'Gtk2::Button' );

Perhaps something is wrong with the signal_connect on my button?

   my $button = Gtk2::Button->new_with_label("RSS");
   $button->signal_connect("released", \&menu_show);

Thanks very much for your help.

--
Lee Aylward




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]