On Mon, 2004-07-19 at 12:25, Artūras Šlajus wrote:
> $usertree->signal_connect('button-press-event' => sub {
> my $event = $_[1];
> if ($event->button == 3) {
> $gladexml->get_widget('pmUsers')->popup(undef, undef, undef,
> user_selected(), $event->button, 0);
> return TRUE;
> }
> else {
> return FALSE;
> }
> } );
Why do you put user_selected() in the user data slot of popup()? It
would only be used if you provided a positioning callback.
> other way popup appears and disappears quickly.
That's because you connected to button-press-event. Those kind of popup
menus only stay up if you don't release the mouse button. If you want
the more traditional behavior, connect to button-release-event.
> activate_time : the time at which the activation event occurred.
> The activate_time parameter should be the time stamp of the event that
> initiated the popup. If such an event is not available, use
> gtk_get_current_event_time() instead.
>
> i don't really understand from where i should get that activation time..
Well, either use $event->time or Gtk2->get_current_event_time.
HTH,
-Torsten
|