Re: pop-up menus from bonobo?



Hi John,

On Tue, 7 Nov 2000, John Sullivan wrote:
> Currently Nautilus has a lot of duplicate code to handle Bonobo menus    
> (in the menu bar) and GTK menus (for right-click pop-up menus). I'd
> very much like to eliminate much of this duplicate code by converting
> the right-click menus to use Bonobo menus.
  
        Yes, that would be extremely good.
  
> I tried to find an example in Bonobo, but the only relevant code I 
> could find left me confused. In app.c there is apparently a sample
> pop-up menu called "MyStuff". The part that confused me is that the
> code that used this created a GTK menu from scratch, and then called
> bonobo_window_add_popup with the path /popups/MyStuff and the GTK
> menu. 
 
        Yes; this inserts a container widget into the tree model.

> Then it used another GtkMenu call to make the popup appear. Do you
> need to manually create a GTK menu to use a popup? If so, I don't
> understand what the advantage of getting Bonobo involved is. Is there
> some way to pop up a menu defined in an xml file?
 
        The popup code is almost entirely unused, and was rather an
afterthought I'm afraid. Due to a lack of time it has not been tested
much. It is possible that while working the API is not very
useful. But; tell me again what do you want to do ?
  
        If you trap a mouse click on the BonoboWindow end, and want to    
throw up a context sensitive menu for the component; this is easy. You    
just do as above.
  
        If the component wants to throw up its own popup menu you will    
have to do that in the normal way, and this doesn't allow for re-using the
merging logic.
  
        There is no way for the component to tell its container to show a
popup at a location where it has just received a button press.

        That's the state of play; if you have any ideas on how to improve
the situation I'd be most interested, currently I have no time to
investigate it.         
  
        Regards,
  
                Michael.

-- 
 mmeeks gnu org  <><, Pseudo Engineer, itinerant idiot





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