Re: [gtkmm] Getting Clist headers to do menu popup.



>  The problem is, I want pop_menu to pop up a popup menu when I click
>the header.  Gtk::Menu->pop() requires the event->button and
>event->time.  How do I get that information?
>
>  Right now I'm faking it with:
>
>    void pop_menu(gint which_column, Gtk::Menu* menu) {
>      menu->popup(1, 0);
>    }

the button can be any value you want - it is actually useful sometimes
to use something other than the button that initiated the handler
(e.g. you right click to get the menu, but then want normal button1
handling of the menu - pass 1 as the button ID, even though
event->button was 3).

passing 0 as the time is also fine, but using GDK_CURRENT_TIME is
better (and identical).

--p



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