The menu core and the menu frame is created together.

Because the frame core width is 1, we can replace it in the wcore
creation. Now, we use the "width" variable to do it.

Signed-off-by: Rodolfo García Peñas (kix) <[email protected]>
---
 src/menu.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/menu.c b/src/menu.c
index 759994c..25ce9da 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -138,6 +138,7 @@ WMenu *wMenuCreate(WScreen *screen, const char *title, int 
main_menu)
        WMenu *menu;
        static int brother = 0;
        int tmp, flags;
+       int width = 1;
 
        menu = wmalloc(sizeof(WMenu));
 
@@ -153,7 +154,9 @@ WMenu *wMenuCreate(WScreen *screen, const char *title, int 
main_menu)
                menu->flags.titled = 1;
        }
 
-       menu->frame = wframewindow_create(1, 1);
+       menu->frame = wframewindow_create(width, 1);
+       menu->menu = wcore_create(width, 10);
+
        wframewindow_map(menu->frame, screen, tmp, 8, 2,
                         &wPreferences.menu_title_clearance,
                         &wPreferences.menu_title_min_height,
@@ -197,7 +200,6 @@ WMenu *wMenuCreate(WScreen *screen, const char *title, int 
main_menu)
 
        menu->frame->on_click_right = menuCloseClick;
 
-       menu->menu = wcore_create(menu->frame->core->width, 10);
        wcore_map(menu->menu, menu->frame->core,
                  menu->frame->core->screen_ptr, 0,
                  menu->frame->top_width, 0,
-- 
1.8.4.rc3


-- 
To unsubscribe, send mail to [email protected].

Reply via email to