PatchworkOS
Loading...
Searching...
No Matches

Widget element wrappers. More...

Functions

element_tbutton_new (element_t *parent, element_id_t id, const rect_t *rect, const char *text, element_flags_t flags)
 Create a new button element.
 
element_tlabel_new (element_t *parent, element_id_t id, const rect_t *rect, const char *text, element_flags_t flags)
 Create a new label element.
 

Detailed Description

Widget element wrappers.

These functions create common widget elements such as buttons and labels by creating elements with predefined procedures and private data.

Function Documentation

◆ button_new()

element_t * button_new ( element_t parent,
element_id_t  id,
const rect_t rect,
const char *  text,
element_flags_t  flags 
)

Create a new button element.

Parameters
parentThe parent element.
idThe element ID.
rectThe rectangle defining the button's position and size.
textThe button's text.
flagsElement flags.
Returns
On success, a pointer to the newly created button element. On failure, NULL and errno is set.

Definition at line 308 of file button.c.

References button_procedure(), element_new(), and NULL.

Referenced by numpad_button_create(), popup_procedure(), start_menu_load_entries(), taskbar_entry_add(), taskbar_procedure(), and window_deco_init_controls().

◆ label_new()

element_t * label_new ( element_t parent,
element_id_t  id,
const rect_t rect,
const char *  text,
element_flags_t  flags 
)

Create a new label element.

Parameters
parentThe parent element.
idThe element ID.
rectThe rectangle defining the label's position and size.
textThe label's text.
flagsElement flags.
Returns
On success, a pointer to the newly created label element. On failure, NULL and errno is set.

Definition at line 45 of file label.c.

References element_new(), label_procedure(), and NULL.

Referenced by procedure(), and taskbar_procedure().