Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Related Pages

Button: The Basic Button

The button class is a basic button with a label. This class inherits from the Ewl_Box to allow for placing any other widget inside the button. More...

Data Structures

struct  Ewl_Button
 A simple Ewl_Widget to provide for a clickable button in the UI. Provides easy facilities for adding a Ewl_Text label to the button, but allows for placing any number of Ewl_Widget's in the Ewl_Button. More...

struct  Ewl_Button
 A simple Ewl_Widget to provide for a clickable button in the UI. Provides easy facilities for adding a Ewl_Text label to the button, but allows for placing any number of Ewl_Widget's in the Ewl_Button. More...


Defines

#define EWL_BUTTON(button)   ((Ewl_Button *) button)
 Typecast a pointer to an Ewl_Button pointer.


Typedefs

typedef Ewl_Button Ewl_Button
 The button provides a simple wrapper for creating a clickable Ewl_Widget with an Ewl_Text displayed inside.


Functions

Ewl_Widgetewl_button_new (char *l)
 Allocate and initialize a new button.

int ewl_button_init (Ewl_Button *b, char *label)
 Initialize a button to starting values.

void ewl_button_label_set (Ewl_Button *b, char *l)
 Change the label of the specified button.

char * ewl_button_label_get (Ewl_Button *b)
 Retrieve the label of the specified button.


Detailed Description

The button class is a basic button with a label. This class inherits from the Ewl_Box to allow for placing any other widget inside the button.


Function Documentation

int ewl_button_init Ewl_Button b,
char *  label
 

Initialize a button to starting values.

Parameters:
b: the button to initialize
label: set the label of the button to label
Returns:
Returns no value.
Initializes a button to default values and callbacks.

char* ewl_button_label_get Ewl_Button b  ) 
 

Retrieve the label of the specified button.

Parameters:
b: the buttons whose label will be returned
Returns:
A newly allocated copy of the label on the button.

void ewl_button_label_set Ewl_Button b,
char *  l
 

Change the label of the specified button.

Parameters:
b: the buttons whose label will be changed
l: the new label for the button
Returns:
Returns no value.

Ewl_Widget* ewl_button_new char *  label  ) 
 

Allocate and initialize a new button.

Parameters:
label: the string to use as a label for the button
Returns:
Returns NULL on failure, a pointer to a new button on success