Allow setting icon before m_widget is valid.
There is no need to require a valid m_widget, the "realize" handler will take care of things later. Closes #16731 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78270 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1383,14 +1383,12 @@ void wxTopLevelWindowGTK::SetTitle( const wxString &title )
|
|||||||
|
|
||||||
void wxTopLevelWindowGTK::SetIcons( const wxIconBundle &icons )
|
void wxTopLevelWindowGTK::SetIcons( const wxIconBundle &icons )
|
||||||
{
|
{
|
||||||
wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") );
|
|
||||||
|
|
||||||
base_type::SetIcons(icons);
|
base_type::SetIcons(icons);
|
||||||
|
|
||||||
// Setting icons before window is realized can cause a GTK assertion if
|
// Setting icons before window is realized can cause a GTK assertion if
|
||||||
// another TLW is realized before this one, and it has this one as it's
|
// another TLW is realized before this one, and it has this one as it's
|
||||||
// transient parent. The life demo exibits this problem.
|
// transient parent. The life demo exibits this problem.
|
||||||
if (gtk_widget_get_realized(m_widget))
|
if (m_widget && gtk_widget_get_realized(m_widget))
|
||||||
{
|
{
|
||||||
GList* list = NULL;
|
GList* list = NULL;
|
||||||
for (size_t i = icons.GetIconCount(); i--;)
|
for (size_t i = icons.GetIconCount(); i--;)
|
||||||
|
Reference in New Issue
Block a user