Enlightenment CVS committal Author : doursse Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src Modified Files: ewl_menu.c ewl_menu.h Log Message: wait the popup to be realized before moving it =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_menu.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -3 -r1.27 -r1.28 --- ewl_menu.c 19 Jan 2005 17:49:23 -0000 1.27 +++ ewl_menu.c 21 Jan 2005 17:50:50 -0000 1.28 @@ -82,14 +82,9 @@ /* * Position the popup menu relative to the menu. */ - if (EWL_MENU_ITEM(w)->inmenu) { - ewl_window_move(EWL_WINDOW(menu->base.popup), - x + CURRENT_W(w), y); - } - else { - ewl_window_move(EWL_WINDOW(menu->base.popup), x, - y + CURRENT_H(w)); - } + ewl_callback_append(EWL_WIDGET(EWL_WINDOW(menu->base.popup)), + EWL_CALLBACK_REALIZE, + ewl_menu_popup_move_cb, w); DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -107,3 +102,19 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } + +void ewl_menu_popup_move_cb(Ewl_Widget * w, void *ev_data, void *user_data) +{ + Ewl_Widget *menu = EWL_WIDGET (user_data); + + if (EWL_MENU_ITEM(menu)->inmenu) { + ewl_window_move(EWL_WINDOW(w), + EWL_MENU(menu)->popup_x + CURRENT_W(menu), + EWL_MENU(menu)->popup_y); + } + else { + ewl_window_move(EWL_WINDOW(w), + EWL_MENU(menu)->popup_x, + EWL_MENU(menu)->popup_y + CURRENT_H(menu)); + } +} =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_menu.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- ewl_menu.h 21 Jul 2004 05:47:44 -0000 1.8 +++ ewl_menu.h 21 Jan 2005 17:50:50 -0000 1.9 @@ -32,19 +32,32 @@ */ struct Ewl_Menu { - Ewl_Menu_Base base; + Ewl_Menu_Base base; + int popup_x; + int popup_y; }; -Ewl_Widget *ewl_menu_new(char *image, char *title); -void ewl_menu_init(Ewl_Menu * menu, char *image, char *title); +Ewl_Widget *ewl_menu_new (char *image, + char *title); + +void ewl_menu_init (Ewl_Menu *menu, + char *image, + char *title); /* * Internally used callbacks, override at your own risk. */ -void ewl_menu_configure_cb(Ewl_Widget *w, void *ev_data, - void *user_data); -void ewl_menu_expand_cb(Ewl_Widget * w, void *ev_data, - void *user_data); +void ewl_menu_configure_cb (Ewl_Widget *w, + void *ev_data, + void *user_data); + +void ewl_menu_expand_cb (Ewl_Widget *w, + void *ev_data, + void *user_data); + +void ewl_menu_popup_move_cb (Ewl_Widget *w, + void *ev_data, + void *user_data); /** * @} ------------------------------------------------------- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs