Re: [Nautilus-list] Ramiro: Information on nautilus_pop_up_context_menu()



Hi Nate,

There are some comments in the implementation of
nautilus_pop_up_context_menu that explain the details of its workings. The
reason the function was invented was to have a cover for popping up a
context menu offset by a few pixels from the mouse position, so that
clicking and releasing would not select the first menu item. By default, the
menu appears under the mouse button, so you would get this dangerous
behavior with a quick click/release.

Later, we added the button-number-setting code for the reason explained in
the comment.

John

on 2/4/01 6:45 PM, Nate Case at nd kracked com wrote:

> Disclaimer: This question doesn't relate specifically to nautilus, but it
> was requested that this question was sent here anyways.
> 
> Hi,
> 
> I am trying to get right-click context menus to act more friendly in an
> application (galeon), similar to that how they work in Nautilus for the
> most part. Specifically, the goal is that the user can either right-click,
> or hold down the right button and still get a menu up (currently you can
> only click, or hold, depending on if we use "click" or "button_press").
> 
> Because of the general ugliness that resulted when trying to combine the
> two, I decided to look and see how Nautilus did this -- and came across
> the gtk extensions function nautilus_pop_up_context_menu().
> 
> While I kind of understand and follow the logic behind this function, I
> was wondering if the author (Ramiro Estrugo) could give a little more
> background information on why this was necessary to do it this way, why it
> doesn't use a gnome popup menu instead of the gtk_menu_popup(), and
> finally, if this would still be necessary with Gtk+ 2.0.
> 
> Thanks in advance






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