Esempio n. 1
0
static gboolean
button_pressed(GtkButton *button, GdkEventButton *event, GtkWidget *widget)
{
    gint toolbar_type, button_type;

    switch (event->button) {
    case 3:
        toolbar_type = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(widget),
                                       OBJECT_DATA_TOOLBAR_TYPE));
        if (toolbar_type == TYPE_APPLET)
            gtk_propagate_event(gtk_widget_get_parent(GTK_WIDGET(button)),
                                (GdkEvent *)event);
        else
            right_button_pressed(button, event, widget);
        break;
    case 2:
        gtk_propagate_event(gtk_widget_get_parent(GTK_WIDGET(button)),
                            (GdkEvent *)event);
        break;
    case 1:
    default:
        button_type = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(button),
                                      OBJECT_DATA_BUTTON_TYPE));
        if (button_type == BUTTON_PROP)
            popup_prop_menu(button, event, widget);
        break;
    }

    return FALSE;
}
Esempio n. 2
0
extern gboolean tab_pressed(GtkWidget *widget, GdkEventButton *event,
			display_data_t *display_data)
{
	signal_params_t signal_params;
	signal_params.display_data = display_data;
	signal_params.button_list = &grid_button_list;

	/* single click with the right mouse button? */
	gtk_notebook_set_current_page(GTK_NOTEBOOK(main_notebook),
				      display_data->extra);
	if ((display_data->extra != TAB_PAGE) && (event->button == 3))
		right_button_pressed(NULL, NULL, event,
				     &signal_params, TAB_CLICKED);
	return true;
}