Forcing an applet to popup its context menu

I am coding an applet that shows a button in the panel.  I would
like one action to happen when the user left-clicks the button,
but when the user right-clicks, I would like to show the applet's
context menu.

Currently, I'm connecting the button's "button_press_event" signal
to a callback that would be written like this:

gboolean on_button_press(GtkWidget *, GdkEventButton *event, gpointer)
    if (event->button == 1)
	return TRUE;
    if (event->button == 3)
	/* show applet context menu */
	return TRUE;
    return FALSE;

I'd like to know how to code the second if().

I see that there is the panel_applet_get_popup_component() function
in <>,
but then I wouldn't know what to do with the resulting BonoboUIComponent
pointer.  Thanks.

Pierre Sarrazin <sarrazip at sympatico dot ca>

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