/[emacs]/emacs/src/xmenu.c
ViewVC logotype

Diff of /emacs/src/xmenu.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.243 by lektu, Tue Feb 4 14:03:17 2003 UTC revision 1.244 by jhd, Sat Feb 8 11:18:32 2003 UTC
# Line 2241  static Lisp_Object *volatile menu_item_s Line 2241  static Lisp_Object *volatile menu_item_s
2241     create_and_show_popup_menu below.  */     create_and_show_popup_menu below.  */
2242  struct next_popup_x_y  struct next_popup_x_y
2243  {  {
2244      FRAME_PTR f;
2245    int x;    int x;
2246    int y;    int y;
2247  };  };
# Line 2252  struct next_popup_x_y Line 2253  struct next_popup_x_y
2253     PUSH_IN is not documented in the GTK manual.     PUSH_IN is not documented in the GTK manual.
2254     USER_DATA is any data passed in when calling gtk_menu_popup.     USER_DATA is any data passed in when calling gtk_menu_popup.
2255     Here it points to a struct next_popup_x_y where the coordinates     Here it points to a struct next_popup_x_y where the coordinates
2256     to store in *X and *Y are.     to store in *X and *Y are as well as the frame for the popup.
2257    
2258     Here only X and Y are used.  */     Here only X and Y are used.  */
2259  static void  static void
# Line 2263  menu_position_func (menu, x, y, push_in, Line 2264  menu_position_func (menu, x, y, push_in,
2264       gboolean *push_in;       gboolean *push_in;
2265       gpointer user_data;       gpointer user_data;
2266  {  {
2267    *x = ((struct next_popup_x_y*)user_data)->x;    struct next_popup_x_y* data = (struct next_popup_x_y*)user_data;
2268    *y = ((struct next_popup_x_y*)user_data)->y;    GtkRequisition req;
2269      int disp_width = FRAME_X_DISPLAY_INFO (data->f)->width;
2270      int disp_height = FRAME_X_DISPLAY_INFO (data->f)->height;
2271      
2272      *x = data->x;
2273      *y = data->y;
2274    
2275      /* Check if there is room for the menu.  If not, adjust x/y so that
2276         the menu is fully visible.  */
2277      gtk_widget_size_request (GTK_WIDGET (menu), &req);
2278      if (data->x + req.width > disp_width)
2279        *x -= data->x + req.width - disp_width;
2280      if (data->y + req.height > disp_height)
2281        *y -= data->y + req.height - disp_height;
2282  }  }
2283    
2284  static void  static void
# Line 2316  create_and_show_popup_menu (f, first_wv, Line 2330  create_and_show_popup_menu (f, first_wv,
2330    
2331        popup_x_y.x = x;        popup_x_y.x = x;
2332        popup_x_y.y = y;        popup_x_y.y = y;
2333          popup_x_y.f = f;
2334      }      }
2335    
2336    /* Display the menu.  */    /* Display the menu.  */

Legend:
Removed from v.1.243  
changed lines
  Added in v.1.244

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26