strange pop up menu behaviour from a clist



Hi.

I set up the third mouse button as GTK_BUTTON_SELECTS on a clist.

I connect "select_row" to a callback that displays a pop up menu when
the third mouse button is pressed:

void 
select_row_callback(GtkWidget *widget, gint row, gint column, 
                    GdkEventButton *bevent, gpointer menu)
{
	if ( bevent->button == 3 ) {
		gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL,
			       0, bevent->time);
	}
}


if I click the third mouse button on that menu, it works immediately,
but if I press the first mouse button, I have to do it twice to activate
a menu option.

I have to do this to make it work as expected, but it contradicts the
purpose of the button parameter on gtk_menu_popup:

void 
select_row_callback(GtkWidget *widget, gint row, gint column,
                    GdkEventButton *bevent, gpointer menu)
{
	if ( bevent->button == 3 ) {
		gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL,
			       0, bevent->time);
	}
}

Is this a bug, a feature, or am I misunderstanding something????

Thanks for your help.




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