Reuse base class helper in wxGTK wxNotebook::InsertPage()
Call DoSetSelectionAfterInsertion() instead of partially duplicating it. This ensures that m_selection is correct after inserting a new page, which wasn't the case before. Surprisingly, this didn't actually matter because wxGTK implementation doesn't really use the base class m_selection neither and just queries GTK+ widget directly for its selection in GetSelection() instead, but it was at the very least confusing.
This commit is contained in:
@@ -483,10 +483,7 @@ bool wxNotebook::InsertPage( size_t position,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (select && GetPageCount() > 1)
|
DoSetSelectionAfterInsertion(position, select);
|
||||||
{
|
|
||||||
SetSelection( position );
|
|
||||||
}
|
|
||||||
|
|
||||||
InvalidateBestSize();
|
InvalidateBestSize();
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user