diff --git a/code/nel/src/gui/ctrl_text_button.cpp b/code/nel/src/gui/ctrl_text_button.cpp index a977902b7..8dbe9b912 100644 --- a/code/nel/src/gui/ctrl_text_button.cpp +++ b/code/nel/src/gui/ctrl_text_button.cpp @@ -886,6 +886,14 @@ namespace NLGUI { _Setuped= true; + if( _ViewText == NULL ) + { + CViewBase *v = CWidgetManager::getInstance()->getParser()->createClass( "text" ); + nlassert( v != NULL ); + _ViewText = dynamic_cast< CViewText* >( v ); + _ViewText->setText( ucstring( "text" ) ); + } + // setup the viewText and add to parent _ViewText->setParent (getParent()); _ViewText->setParentPos (this); diff --git a/code/nel/src/gui/widget_manager.cpp b/code/nel/src/gui/widget_manager.cpp index bad93687b..6e7431b70 100644 --- a/code/nel/src/gui/widget_manager.cpp +++ b/code/nel/src/gui/widget_manager.cpp @@ -3289,6 +3289,7 @@ namespace NLGUI return NULL; v->setId( std::string( g->getId() + ":" + widgetName ) ); + v->setParent( g ); if( v->isGroup() ) g->addGroup( dynamic_cast< CInterfaceGroup* >( v ) ); @@ -3298,8 +3299,6 @@ namespace NLGUI else g->addView( v ); - v->setParent( g ); - notifyAdditionWatchers( v->getId() ); return v;