version 2.8

Detailed Description

PushButton widget.

GWIN allows it to easily create buttons with different styles and check for different meta states such as: PRESSED, CLICKED, RELEASED etc.

GFX_USE_GWIN must be set to TRUE in your gfxconf.h
GWIN_NEED_BUTTON must be set to TRUE in your gfxconf.h

Data Structures

struct  GButtonObject
 The button widget structure. More...


 Built-in rendering functions for the button widget.


GHandle gwinGButtonCreate (GDisplay *g, GButtonObject *gb, const GWidgetInit *pInit)
 Create a button widget. More...
bool_t gwinButtonIsPressed (GHandle gh)
 Is the button current pressed. More...
#define GBUTTON_FLG_PRESSED   0x01
 The internal button flags. More...


 The Event Type for a Button Event. More...


typedef GEventGWin GEventGWinButton
 A Button Event. More...
typedef struct GButtonObject GButtonObject
 The button widget structure. More...

Function Documentation

bool_t gwinButtonIsPressed ( GHandle  gh)

Is the button current pressed.

TRUE if the button is pressed
[in]ghThe window handle (must be a button widget)
Function Class:
Normal API, this function can be invoked by regular system threads.
GHandle gwinGButtonCreate ( GDisplay *  g,
GButtonObject gb,
const GWidgetInit pInit 

Create a button widget.

NULL if there is no resultant drawing area, otherwise a window handle.
[in]gThe GDisplay to display this window on
[in]gbThe GButtonObject structure to initialise. If this is NULL the structure is dynamically allocated.
[in]pInitThe initialisation parameters
The drawing color and the background color get set to the current defaults. If you haven't called gwinSetDefaultColor() or gwinSetDefaultBgColor() then these are White and Black respectively.
The font gets set to the current default font. If you haven't called gwinSetDefaultFont() then there is no default font and text drawing operations will no nothing.
A button remembers its normal drawing state. If there is a window manager then it is automatically redrawn if the window is moved or its visibility state is changed.
A button supports mouse and a toggle input.
When assigning a toggle, only one toggle is supported. If you try to assign more than one toggle it will forget the previous toggle. When assigning a toggle the role parameter must be 0.
Function Class:
Normal API, this function can be invoked by regular system threads.

Macro Definition Documentation

#define GBUTTON_FLG_PRESSED   0x01

The internal button flags.

Used only for writing a custom draw routine.

Definition at line 47 of file gwin_button.h.


The Event Type for a Button Event.

Definition at line 34 of file gwin_button.h.

Typedef Documentation

typedef struct GButtonObject GButtonObject

The button widget structure.

Do not use the members directly - treat it as a black-box.

A Button Event.

There are currently no GEventGWinButton listening flags - use 0 as the flags to gwinAttachListener()

Definition at line 40 of file gwin_button.h.