peng3d.gui.container
- GUI Container and Scrolling system¶
-
class
peng3d.gui.container.
Container
(name, submenu, window, peng, pos=None, size=None)[source]¶ Main class of the container system.
This widget may contain other widgets, limiting the childs to only draw within the defined bounds. Additionally, the given position will also act as a offset, making the child coordinates relative to the parent.
This Class is a subclass of
peng3d.gui.widgets.Widget
but also exhibits part of the API ofpeng3d.gui.SubMenu
.-
addWidget
(widget)[source]¶ Adds a widget to this container.
Note that trying to add the Container to itself will be ignored.
-
draw
()[source]¶ Draws the submenu and its background.
Note that this leaves the OpenGL state set to 2d drawing and may modify the stencil settings and buffer.
-
on_enter
(old)[source]¶ Dummy method defined for compatibility with
peng3d.gui.SubMenu
, simply does nothing.
-
on_exit
(new)[source]¶ Dummy method defined for compatibility with
peng3d.gui.SubMenu
, simply does nothing.
-
setBackground
(bg)[source]¶ Sets the background of the Container.
Similar to
peng3d.gui.SubMenu.setBackground()
, but only effects the region covered by the Container.
-
-
class
peng3d.gui.container.
ScrollableContainer
(name, submenu, window, peng, pos=None, size=None, scrollbar_width=12, borderstyle='flat', content_height=100)[source]¶ Subclass of
Container
allowing for scrolling its content.The scrollbar currently is always on the right side and simply consists of a
peng3d.gui.slider.VerticalSlider
.scrollbar_width
andborderstyle
will be passed to the scrollbar.content_height
refers to the maximum offset the user can scroll to.The content height may be changed, but manually calling
redraw()
will be necessary.