Added member function Fl_Sys_Menu_Bar::update().

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9997 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2013-10-05 15:20:18 +00:00
parent dc2f7ba034
commit 83e4329695
2 changed files with 12 additions and 6 deletions

View File

@ -48,14 +48,13 @@ public:
int insert(int index, const char* label, int shortcut, Fl_Callback *cb, void *user_data=0, int flags=0);
void remove(int n);
void replace(int rank, const char *name);
#ifdef __APPLE__
void update();
#else
void update() {}
#endif
void clear();
int clear_submenu(int index);
#if ! defined(FL_DOXYGEN)
enum menuOrItemOperation { itemAtIndex, setKeyEquivalent, setKeyEquivalentModifierMask, setState, initWithTitle,
numberOfItems, setSubmenu, setEnabled, addSeparatorItem, setTitle, removeItem, addNewItem };
// function doMenuOrItemOperation is in file Fl_cocoa.mm because it contains objective-c code
static void *doMenuOrItemOperation( menuOrItemOperation operation, ...);
#endif
};
#else

View File

@ -415,6 +415,13 @@ void Fl_Sys_Menu_Bar::replace(int rank, const char *name)
convertToMenuBar(Fl_Menu_::menu());
}
/** Updates the system menu.
Useful after changes in the menu items, e.g., item activation/deactivation.
*/
void Fl_Sys_Menu_Bar::update()
{
convertToMenuBar(Fl_Menu_::menu());
}
/*
* Draw the menu bar.