Started by Nafffen, 28 March 2023, 10:55:15
auto panels = tgui::Group::create(); panels->setPosition(0, tgui::bindBottom(btnWarehouse)+m_spaceY); panels->setSize("100%", "100%"-tgui::bindHeight(btnWarehouse)-m_spaceY*2); panels->loadWidgetsFromFile("data/forms/vehicleManager.fc"); m_container->add(panels,"panels");
QuoteDoes VehicleManager inherit from SubwidgetContainer?
QuoteDo you plan to correct this behavior ? Or maybe forbid user to use the function with this class
QuoteWidgets that are placed into the SubwidgetContainer aren't actually part of the gui, they are just part of your custom widget. While my first reaction was that the getAbsolutePosition might be buggy, the behavior is actually by design: the SubwidgetContainer really is the root of everything inside it. You should think of a SubwidgetContainer as a canvas on which you render: the widgets added to m_container are drawn to the canvas (without knowledge of the gui), and the canvas image is later drawn to the gui (without knowledge of how the image was created).
QuoteTherefor what are the benefits to inherit from SubwidgetContainer instead of Group ?