Alvin wrote:

> Hello,
> 
> I'm constructing a Open Recent submenu (under File). My app is fully
> constructed using FLUID, so I cannot alter the menu array as is done in
> fluid.cxx.

I'm trying another way by using a FL_SUBMENU_POINTER. I have constructed
another menu array that contains the submenu entries (sorry for the
wrapping):

static char recent_files[MAX_RECENT_FILES][1024];

Fl_Menu_Item recent_menu[] =
{
        {recent_files[0], FL_COMMAND+'0', (Fl_Callback*)file_open, 
recent_files[0],
0, FL_NORMAL_LABEL, 0, 14, 0},
        {recent_files[1], FL_COMMAND+'1', (Fl_Callback*)file_open, 
recent_files[1],
0, FL_NORMAL_LABEL, 0, 14, 0},
        {recent_files[2], FL_COMMAND+'2', (Fl_Callback*)file_open, 
recent_files[2],
0, FL_NORMAL_LABEL, 0, 14, 0},
        {recent_files[3], FL_COMMAND+'3', (Fl_Callback*)file_open, 
recent_files[3],
0, FL_NORMAL_LABEL, 0, 14, 0},
        {0,0,0,0,0,0,0,0,0}
};

In fluid, I added a Submenu under the top File menu. In the widget
properties for the submenu, I added "recent_menu" as the user_data. The
generated source sets the FL_SUBMENU_POINTER flag correctly.

In the app, I then populate the recent_files array, so each item in the
array is set to something.

When I start the app, the menubar is all messed up. I partially get the File
menu, but it appears to be ripped apart after the Submenu. Does the
FL_SUBMENU_POINTER terminate the menu array constructed by FLUID? I'm not
quite sure how I'm using FL_SUBMENU_POINTER wrong.

Thanks

-- 
Alvin
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to