Re: gtk_menu_popup problem




Hi,

Your question belongs to gtk-app-devel-list rather than this one, but anyway.

If you do a popup in response to an event, you have a timestamp available and
you should provide it. This is because GtkMenu tries to differentiate between
"drag-selection" and "click-selection" mode by using the timestamps. So, if it
decides to use "drag-selection", the menu will close after you raise the button.

So, your code could look like the following:

  gtk_menu_popup(GTK_MENU(menu), NULL, NULL,
    NULL, NULL, event->button, event->time);

Hope this helps,

-Markku-


Quoting ali abdallah <ali slackware gmail com>:

Hi all,

I have a application wish load plugin into it, the plugin when
"button-press-event" is received they call a function of the main window and
then the main window should popup a menu, but it doesn't, i have to click
very fast on the plugin many times in order for the menu to be shown.

i call gtk_menu_popup like that

gtk_menu_popup(GTK_MENU(menu),NULL,NULL,
                       NULL,NULL,0,GDK_CURRENT_TIME);

or like this

gtk_menu_popup(GTK_MENU(menu),NULL,NULL,
                       NULL,NULL,0,gtk_get_current_event_time());


Any help please.

Best Regards.






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