Examples which position popup menus?



I'm writing a Gtk::AppletWidget script, and upon clicking the applet
itself, I'd like a popup menu to appear.  So far, that works.

    $menu->popup(undef, # parent menu shell
                 undef, # parent menu item
                 time(), # activate time
                 $applet, # button causing event(?)
                 undef, # positioning callback
                 undef); # data for positioning callback

However, two annoyances.  One, the menu is not aligned in such a way as
to avoid overlapping the applet, and two, the menu cannot be dismissed
in any way except by choosing one of its items with the mouse.

For the GNOME 1.4 panel, and for some other applets, popup menus are
aligned with their edges adjacent to the applet (or launcher) edge. 
Thus, a menu will pop up just above the applet or launcher on a
bottom-edge panel, and just below for top-edge panels, etc.

Also in other app examples, clicking the original applet (or pretty much
anywhere else except the menu) will dismiss the menu with no choice
made.  Keyboard input is accepted, allowing the user to subsequently
navigate the menu at will.

If anyone has ideas or resources on how to achieve either or both of
these behaviors, please share.

-- 
[ e d @ h a l l e y . c c ]



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