discoverpixy
Data Structures | Macros | Typedefs | Functions
Button
Collaboration diagram for Button:

Data Structures

struct  BUTTON_STRUCT
 

Macros

#define AUTO   0
 Use this value instead of x2, y2 in the BUTTON_STRUCT to autocalculate the button width/height. More...
 

Typedefs

typedef void(* BUTTON_CALLBACK) (void *button)
 

Functions

bool gui_button_add (BUTTON_STRUCT *button)
 
void gui_button_remove (BUTTON_STRUCT *button)
 
void gui_button_redraw (BUTTON_STRUCT *button)
 

Detailed Description

The Button Gui-Element

Macro Definition Documentation

#define AUTO   0

Use this value instead of x2, y2 in the BUTTON_STRUCT to autocalculate the button width/height.

Typedef Documentation

typedef void(* BUTTON_CALLBACK) (void *button)

Prototype for Event Listeners (called when the button is pressed)

Parameters
buttonThe pointer to the BUTTON_STRUCT where to corresponding Button was pressed

Function Documentation

bool gui_button_add ( BUTTON_STRUCT button)

Adds a button. Your Callback will be called from now on, if the button was pressed

Parameters
buttonA Pointer to the preinitialized BUTTON_STRUCT
Returns
true on success

Here is the call graph for this function:

Here is the caller graph for this function:

void gui_button_redraw ( BUTTON_STRUCT button)

Redraws the button. Call this method if you have to redraw the entire screen or if you want to draw a button on top of an image.

Parameters
buttonA Pointer to the BUTTON_STRUCT

Here is the call graph for this function:

Here is the caller graph for this function:

void gui_button_remove ( BUTTON_STRUCT button)

Removes the button. You will no longer receive events for this button. This function will not overdraw the region where the button was located.

Parameters
buttonA Pointer to the BUTTON_STRUCT

Here is the call graph for this function:

Here is the caller graph for this function: