#include "NasalWidget.hxx"
#include <simgear/canvas/Canvas.hxx>
+#include <simgear/nasal/cppbind/NasalContext.hxx>
#include <simgear/nasal/cppbind/Ghost.hxx>
namespace simgear
void NasalWidget::setGeometry(const SGRect<int>& geom)
{
if( _geometry != geom )
+ {
_geometry = geom;
- else if( !(_flags & LAYOUT_DIRTY) || !_set_geometry )
+ _flags |= LAYOUT_DIRTY;
+ }
+
+ if( !_set_geometry || !(_flags & LAYOUT_DIRTY) )
return;
- naContext c = naNewContext();
try
{
+ nasal::Context c;
_set_geometry(nasal::to_nasal(c, this), geom);
_flags &= ~LAYOUT_DIRTY;
}
"NasalWidget::setGeometry: callback error: '" << ex.what() << "'"
);
}
- naFreeContext(c);
}
//----------------------------------------------------------------------------