don't try to refresh the menu bar before showing it, fixes crash on startup with wxGTK

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11366 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2001-08-13 14:59:08 +00:00
parent 8f974c520a
commit 4087064a38

View File

@@ -1682,6 +1682,12 @@ wxString wxMenuBar::GetLabelTop(size_t pos) const
void wxMenuBar::RefreshAllItemsAfter(size_t pos)
{
if ( !IsCreated() )
{
// no need to refresh if nothing is shown yet
return;
}
wxRect rect = GetItemRect(pos);
rect.width = GetClientSize().x - rect.x;
RefreshRect(rect);
@@ -1692,6 +1698,12 @@ void wxMenuBar::RefreshItem(size_t pos)
wxCHECK_RET( pos != (size_t)-1,
_T("invalid item in wxMenuBar::RefreshItem") );
if ( !IsCreated() )
{
// no need to refresh if nothing is shown yet
return;
}
RefreshRect(GetItemRect(pos));
}
@@ -1760,6 +1772,7 @@ void wxMenuBar::DoDraw(wxControlRenderer *renderer)
wxRect wxMenuBar::GetItemRect(size_t pos) const
{
wxASSERT_MSG( pos < GetCount(), _T("invalid menu bar item index") );
wxASSERT_MSG( IsCreated(), _T("can't call this method yet") );
wxRect rect;
rect.x =