boot loader: MenuItem: Add SetLabel()
This commit is contained in:
parent
2a368f9b0e
commit
cbfc38c62d
@ -57,6 +57,7 @@ public:
|
||||
char Shortcut() const { return fShortcut; }
|
||||
|
||||
const char* Label() const { return fLabel; }
|
||||
void SetLabel(const char* label);
|
||||
|
||||
Menu* Submenu() const { return fSubMenu; }
|
||||
void SetSubmenu(Menu* subMenu);
|
||||
|
@ -180,6 +180,16 @@ MenuItem::SetShortcut(char key)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
MenuItem::SetLabel(const char* label)
|
||||
{
|
||||
if (char* newLabel = strdup(label)) {
|
||||
free(const_cast<char*>(fLabel));
|
||||
fLabel = newLabel;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
MenuItem::SetSubmenu(Menu* subMenu)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user