The editor probably shouldn't crash when adding textbutton widget.

This commit is contained in:
dfighter1985 2013-05-10 02:10:18 +02:00
parent 80720c0137
commit 4717f03b3a
2 changed files with 9 additions and 2 deletions

View file

@ -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);

View file

@ -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;