muteki
Loading...
Searching...
No Matches
button.h File Reference

Button widget API. More...

#include <muteki/ui/common.h>

Go to the source code of this file.

Data Structures

struct  ui_widget_button_s
 

Typedefs

typedef struct ui_widget_button_s ui_widget_button_t
 

Functions

ui_widget_button_tCreateButton (unsigned short tag, short x0, short y0, short x1, short y1, UTF16 *label, unsigned int event, unsigned short flags)
 Create a button widget object.
 

Detailed Description

Button widget API.

Function Documentation

◆ CreateButton()

ui_widget_button_t * CreateButton ( unsigned short  tag,
short  x0,
short  y0,
short  x1,
short  y1,
UTF16 label,
unsigned int  event,
unsigned short  flags 
)

Create a button widget object.

Todo:

Test the event behavior. This needs more reverse engineering on the view event handling process.

Figure out the flags.

Parameters
tagComponent tag. Can be used to distinguish components under some circumstances (like when sharing a callback with another component). Does not need to be unique. Usually will be set by AllocBlock() after the memory was allocated.
x0X coordinate of the top-left corner, in pixels (inclusive).
y0Y coordinate of the top-left corner, in pixels (inclusive).
x1X coordinate of the bottom-right corner, in pixels (inclusive), or 0 to let the function automatically decide the size.
y1Y coordinate of the bottom-right corner, in pixels (inclusive), or 0 to let the function automatically decide the size.
labelUTF-16 encoded string to be used as a label.
eventCustom event to be sent on button press.
flagsFlags. Valid options seem to be 2, 4, 0x40.
Returns
The allocated object.