manuel.gysin Posted October 4, 2010 Posted October 4, 2010 Hello I play around with the WidgetVBox and WidgetHBox elements. In my use case there is already a sprite as background and for separating the elements (WidgetIcons in a WidgetGroupBox). I now trying to remove the 1 px border for the Box elements, but I can't find any method for this in the documentation. Is there a way to remove this border? Kind regards Manuel
Guest extaliones Posted October 4, 2010 Posted October 4, 2010 Try the following way after gui is loaded from ui file: call the Widget::arrange() function which visually re-arranges the widget and its children to lay them out neatly
manuel.gysin Posted October 4, 2010 Author Posted October 4, 2010 Try the following way after gui is loaded from ui file: call the Widget::arrange() function which visually re-arranges the widget and its children to lay them out neatly Hi extaliones Thanks for the tip, but is does not work: WidgetHBox with WidgetGroupBox as child and sprite as background (child from gui): WidgetHBox with WidgetGroupBox as child without sprite: Edit: The border is linked somehow with the WidgetGroupBox, not the WidgetHBox sorry. Kind Regards Manuel
danni.coy Posted October 5, 2010 Posted October 5, 2010 Hi extaliones Thanks for the tip, but is does not work: WidgetHBox with WidgetGroupBox as child and sprite as background (child from gui): WidgetHBox with WidgetGroupBox as child without sprite: Edit: The border is linked somehow with the WidgetGroupBox, not the WidgetHBox sorry. Kind Regards Manuel A WidgetGroupBox is more or less a WidgetVBox that draws a border around itself. you can modify how that border looks by modifying the png files in data/core/gui or if you don't want a border at all - just use WidgetVBox 1
Guest extaliones Posted October 5, 2010 Posted October 5, 2010 It is a visual element (like border) of WidgetGroupBox to disable this visual use the following method WidgetGroupBox::setBackground(0). Or you can add skin layout for border, please, the following documentation: Programming/ GUI/Skin Layout
manuel.gysin Posted October 5, 2010 Author Posted October 5, 2010 A WidgetGroupBox is more or less a WidgetVBox that draws a border around itself. you can modify how that border looks by modifying the png files in data/core/gui or if you don't want a border at all - just use WidgetVBox Thanks, I didn't realized that, I switched now to a WidgetVBox. It is a visual element (like border) of WidgetGroupBox to disable this visual use the following method WidgetGroupBox::setBackground(0). Or you can add skin layout for border, please, the following documentation: Programming/ GUI/Skin Layout Thanks, but WidgetGroupBox::setBackground(0) has no effect: Gui gui; gui = engine.getGui(); WidgetGroupBox testBox; testBox = new WidgetGroupBox(gui); testBox.setWidth(200); testBox.setHeight(200); testBox.setBackground(0); gui.addChild(testBox, GUI_ALIGN_OVERLAP); But I now understand the border and how to change the png for it, thanks a lot! (and sorry, I totally over read this documentation part)
Recommended Posts