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

Button_Stock: A Button with a Stock Icon in it.

The button_stock class is a button with a stock icon or a label. This class inherits from the Ewl_Button. Stock icons are pre-defined and are referenced by an Id. More...

Data Structures

struct  _Ewl_Button_Stock
 A button with a label, and eventually an image. A convenient way to add the image is the use of stock icons. Stock icons are pre-defined icons, referenced by a Id. These icons have also a label, which set the label of the button and an Id in order to identify a response (see ewl_dialog_button_set()). More...

struct  _Ewl_Button_Stock
 A button with a label, and eventually an image. A convenient way to add the image is the use of stock icons. Stock icons are pre-defined icons, referenced by a Id. These icons have also a label, which set the label of the button and an Id in order to identify a response (see ewl_dialog_button_set()). More...


Defines

#define EWL_BUTTON_STOCK(button)   ((Ewl_Button_Stock *) button)
 Typecast a pointer to an Ewl_Button_Stock pointer.


Typedefs

typedef _Ewl_Button_Stock Ewl_Button_Stock
 The button_stock provides a simple wrapper for creating a button with predefined icons.


Functions

Ewl_Widgetewl_button_stock_new (char *stock_id)
 Allocate and initialize a new button with eventually a stock icon.

Ewl_Widgetewl_button_stock_with_id_new (char *stock_id, int response_id)
 Convenient function to create a (stock) button, with a response id. To add this button in the action_area of a dialog, just use ewl_container_child_append(dialog, button) or ewl_container_child_prepend(dialog, button). Use this way to add buttons, instead of ewl_dialog_button_add() or ewl_dialog_button_left_add().

int ewl_button_stock_init (Ewl_Button_Stock *b, char *stock_id)
 Initialize a button to starting values.


Detailed Description

The button_stock class is a button with a stock icon or a label. This class inherits from the Ewl_Button. Stock icons are pre-defined and are referenced by an Id.


Function Documentation

int ewl_button_stock_init Ewl_Button_Stock b,
char *  stock_id
 

Initialize a button to starting values.

Parameters:
b: the button to initialize.
stock_id: set the stock Id or the label of the button to stock_id.
Returns:
Returns TRUE on success, FALSE otherwise.
Initializes a button to default values and callbacks.

Ewl_Widget* ewl_button_stock_new char *  stock_id  ) 
 

Allocate and initialize a new button with eventually a stock icon.

Parameters:
stock_id: the string to use as a stock If for the button, or just a string for the label.
Returns:
Returns NULL on failure, a pointer to a new button on success.

Ewl_Widget* ewl_button_stock_with_id_new char *  stock_id,
int  response_id
 

Convenient function to create a (stock) button, with a response id. To add this button in the action_area of a dialog, just use ewl_container_child_append(dialog, button) or ewl_container_child_prepend(dialog, button). Use this way to add buttons, instead of ewl_dialog_button_add() or ewl_dialog_button_left_add().

Parameters:
stock_id: the text of the button or a stock Id.
response_id: The Id that will be retured when clicking on the button.
Returns:
Returns a button, or NULL on failure.