1
0
Fork 0

Keep track of the visible/hidden state more robustly.

This commit is contained in:
david 2003-01-18 21:11:15 +00:00
parent b2713841b6
commit 7ae491dc2e

View file

@ -323,23 +323,16 @@ FGMenuBar::init ()
void void
FGMenuBar::show () FGMenuBar::show ()
{ {
if (_menuBar != 0) { if (_menuBar != 0)
_menuBar->reveal(); _menuBar->reveal();
_visible = true; _visible = true;
} else {
SG_LOG(SG_GENERAL, SG_ALERT, "No menu bar to show");
_visible = false;
}
} }
void void
FGMenuBar::hide () FGMenuBar::hide ()
{ {
if (_menuBar != 0) { if (_menuBar != 0)
_menuBar->hide(); _menuBar->hide();
} else {
SG_LOG(SG_GENERAL, SG_ALERT, "No menu bar to show");
}
_visible = false; _visible = false;
} }
@ -403,6 +396,10 @@ FGMenuBar::make_menubar ()
make_menu(menu_nodes[i]); make_menu(menu_nodes[i]);
_menuBar->close(); _menuBar->close();
if (_visible)
_menuBar->reveal();
else
_menuBar->hide();
} }
// end of menubar.cxx // end of menubar.cxx