bool Frame::setWindow(Window* window) { if(!window) return false; EmbeddedWindow* ew = getEmbeddedWindow(); // If it's the first time setting the Window... // if(!ew || !ew->getWindow()) return addWidget(window->embed(), 1, 1); if(!ew) return addWidget(window->embed(), 1, 1); else return ew->setWindow(window); }
Window::EmbeddedWindow* Window::embed( const std::string& newName, Widget::Layer layer, unsigned int layerOffset ) { EmbeddedWindow* ew = new EmbeddedWindow( newName.size() > 0 ? newName : _name + "Embedded", getWidth(), getHeight() ); ew->setWindow(this); ew->setSize(getWidth(), getHeight()); ew->setCanFill(true); ew->setLayer(layer, layerOffset); return ew; }