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);
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));
}
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 =