libGumball 0.0.2
C23-Based, libGimbal-powered UI Library
Loading...
Searching...
No Matches
gumball_container.h File Reference

Go to the source code of this file.

Macros

#define GUM_Container_create(...)
Type System

Type UUID and cast operators

#define GUM_CONTAINER_TYPE
#define GUM_CONTAINER(self)
#define GUM_CONTAINER_CLASS(klass)
#define GUM_CONTAINER_CLASSOF(self)

Functions

 GBL_CLASS_DERIVE (GUM_Container, GUM_Widget) GBL_RESULT(*pFnUpdateContent)(GBL_SELF)

Properties

Properties you can set/get at or after creation.

Note
You can also set/get properties from parent classes (see GUM_Container).
float margin
float minChildSize
char orientation
bool resizeWidgets
bool alignWidgets
bool scrollable
float scrollOffsetX
float scrollOffsetY
 GBL_INSTANCE_DERIVE (GUM_Container, GUM_Widget) float padding

Detailed Description

GUM_Container data structure and hierarchy graph

GUM_Container is a container element that can hold other widgets. It can be used to group widgets together, and to optionally automatically resize / align them as needed.

Todo
  • Make variables private
  • Make orientation an enum
  • Add scrolling
Author
2025 Agustín Bellagamba

Macro Definition Documentation

◆ GUM_CONTAINER_TYPE

#define GUM_CONTAINER_TYPE

Returns the GUM_Container Type UUID.

◆ GUM_CONTAINER

#define GUM_CONTAINER ( self)

Casts an instance of a compatible element to a GUM_Container.

◆ GUM_CONTAINER_CLASS

#define GUM_CONTAINER_CLASS ( klass)

Casts a class of a compatible element to a GUM_ContainerClass.

◆ GUM_CONTAINER_CLASSOF

#define GUM_CONTAINER_CLASSOF ( self)

Casts an instance of a compatible element to a GUM_ContainerClass.

◆ GUM_Container_create

#define GUM_Container_create ( ...)

Returns a new GUM_Container. Optionally takes in a list of Name/Value pairs for properties.

Function Documentation

◆ GBL_CLASS_DERIVE()

GBL_CLASS_DERIVE ( GUM_Container ,
GUM_Widget  )

Updates the content of the container, resizing and realigning child widgets as needed.

◆ GBL_INSTANCE_DERIVE()

GBL_INSTANCE_DERIVE ( GUM_Container ,
GUM_Widget  )

The space between the container's border and its child widgets.

Default value is 5

Variable Documentation

◆ margin

float margin

The space between child widgets.

Default value is 5

◆ orientation

char orientation

The minimum amount of space a child widget should take, in percentage of the container's size.

Default value is 0.15 (15%) 'h' for horizontal, 'v' for vertical layout of child widgets. Default value is 'v'

Warning
This is planned to be replaced by an enum.

◆ resizeWidgets

bool resizeWidgets

If child widgets should be resized to take an equal amount of space.

Default value is true

◆ alignWidgets

bool alignWidgets

If child widgets should be aligned.

Default value is true

◆ scrollable

bool scrollable

If the container should become scrollable when its content is bigger than itself Default value is true.