I have开发者_开发知识库 a gtk.Menu (which is being used as a popup) and I need to determine whether the mouse cursor is inside the confines of the menu.
I can get the mouse's position on the screen using this method. But how do I get the dimensions and position of the menu after calling menu.popup(...)?
Looks like I didn't look close enough at some of the methods that gtk.Menu provides.
It turns out that gtk.Menu is a descendant of gtk.Widget which has a method get_window which returns the menu's underlying gtk.gdk.Window.
From there, it's simply a matter of calling get_frame_extents() which returns a gtk.gdk.Rectangle with the position and size of the menu.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论