The double click works well, but not the right-click(the popup menu does not show), what trouble is it?
// pack image and title into the eventbox
Box add_conn_box = new Gtk.Box (Gtk.Orientation.VERTICAL, 0);
add_conn_box.append (add_conn_image);
add_conn_box.append (add_conn_label);
add_conn_box.set_data<string>("action", action_name);
add_conn_box.set_data<string>("title", database_connection_title);
add_conn_box.set_data<ServerSetting?>("connection", server);
var button_press_event = new Gtk.GestureClick();
button_press_event.pressed.connect(handle_connection_clicked);
add_conn_box.add_controller(button_press_event);
protected void handle_connection_clicked(Gtk.GestureClick event, int n_press, double x, double y)
{
if ((Gdk.BUTTON_SECONDARY == event.get_current_button()) && (1 == n_press)) {
Gdk.Rectangle rect = { (int)x, (int)y, 0, 0, };
m_context_menu.set_pointing_to(rect);
m_context_menu.popup();
} else if ((Gdk.BUTTON_PRIMARY == event.get_current_button()) && (2 == n_press)) {
string action_name = event_box.get_data<string>("action");
KApplication.singleton.workbench.call_action(StartViewActions.ACTION_GROUP, action_name);
}
}