gnome_popup_menu_do_popup ()



I want to create a popup menu that has 8 options. I want to have a
single callback that, depending on which option was chosen, does
something accordingly.

I am creating the menu:

       GnomeUIInfo popupZoomMenu[] = {
                {GNOME_APP_UI_ITEM, ZoomMagnLabels[0], NULL, 
                 zoom_callback, &temp[4] , NULL,
		 ...

And calling the menu with:

      gnome_popup_menu_do_popup(ggv->popup_zoom_menu, 
                                                  NULL, NULL, event, ggv);


The problem is that the user value that callback receives is not the
one specified when I create the menu (e.g. temp[4]) but ggv, which
is the user data parameter to gnome_popup_menu_do_popup. temp[i]
contains data that allows me to know which option the user has
chosen. 

My question is: is there a way I can just have a single callback
function handle all the menu options? If so, how do I do it?

I know I could write a function for each one of them, but it sounds
excesive. 


Thanks for any help,


--
Daniel M. German                  "A first-rate laboratory is one in 
                                   which mediocre scientists can produce
   Patrick Maynard Stuart Blackett ->outstanding work"
http://turingmachine.org/
dmg csg uwaterloo ca

 




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