Gooey GUI Library
Loading...
Searching...
No Matches
gooey_layout.h File Reference

Header file for the GooeyLayout module. More...

#include "common/gooey_common.h"

Go to the source code of this file.

Functions

GooeyLayout * GooeyLayout_Create (GooeyLayoutType layout_type, int x, int y, int width, int height)
 Creates a layout.
 
void GooeyLayout_AddChild (GooeyLayout *layout, void *widget)
 Adds a child widget to the specified layout.
 
void GooeyLayout_Build (GooeyLayout *layout)
 Arranges all child widgets within the layout.
 

Detailed Description

Header file for the GooeyLayout module.

Provides functionality for managing and arranging widgets within a structured layout inside a GooeyWindow.

Author
Yassine Ahmed Ali @license GPL-3.0

Function Documentation

◆ GooeyLayout_AddChild()

void GooeyLayout_AddChild ( GooeyLayout *  layout,
void *  widget 
)

Adds a child widget to the specified layout.

Registers a widget as a child of the given layout, allowing it to be positioned according to the layout's rules.

Parameters
layoutThe layout to which the widget will be added.
widgetA pointer to the widget to add.

◆ GooeyLayout_Build()

void GooeyLayout_Build ( GooeyLayout *  layout)

Arranges all child widgets within the layout.

This function organizes all registered child widgets based on the layout type (e.g., grid, box), ensuring proper alignment and spacing.

Parameters
layoutThe layout to build.

◆ GooeyLayout_Create()

GooeyLayout * GooeyLayout_Create ( GooeyLayoutType  layout_type,
int  x,
int  y,
int  width,
int  height 
)

Creates a layout.

Initializes a new layout with a specified type, position, and size.

Parameters
layout_typeThe type of layout (e.g., grid, box).
xThe x-coordinate of the layout's position.
yThe y-coordinate of the layout's position.
widthThe width of the layout.
heightThe height of the layout.
Returns
A pointer to the newly created GooeyLayout object.