mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-12-26 18:40:54 +00:00
The editor probably shouldn't crash when adding textbutton widget.
This commit is contained in:
parent
2dbf68d6e4
commit
776c95f12f
2 changed files with 9 additions and 2 deletions
|
@ -886,6 +886,14 @@ namespace NLGUI
|
||||||
{
|
{
|
||||||
_Setuped= true;
|
_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
|
// setup the viewText and add to parent
|
||||||
_ViewText->setParent (getParent());
|
_ViewText->setParent (getParent());
|
||||||
_ViewText->setParentPos (this);
|
_ViewText->setParentPos (this);
|
||||||
|
|
|
@ -3289,6 +3289,7 @@ namespace NLGUI
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
v->setId( std::string( g->getId() + ":" + widgetName ) );
|
v->setId( std::string( g->getId() + ":" + widgetName ) );
|
||||||
|
v->setParent( g );
|
||||||
|
|
||||||
if( v->isGroup() )
|
if( v->isGroup() )
|
||||||
g->addGroup( dynamic_cast< CInterfaceGroup* >( v ) );
|
g->addGroup( dynamic_cast< CInterfaceGroup* >( v ) );
|
||||||
|
@ -3298,8 +3299,6 @@ namespace NLGUI
|
||||||
else
|
else
|
||||||
g->addView( v );
|
g->addView( v );
|
||||||
|
|
||||||
v->setParent( g );
|
|
||||||
|
|
||||||
notifyAdditionWatchers( v->getId() );
|
notifyAdditionWatchers( v->getId() );
|
||||||
|
|
||||||
return v;
|
return v;
|
||||||
|
|
Loading…
Reference in a new issue