Download

Support

Ewl_Button: The Basic 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.

Remarks:
Inherits from Ewl_Stock.

Tutorial

The Ewl_Button includes an icon and label by default but is actually a full container that can hold any type of non-toplevel widget. Because of this flexibility many other widget types inherit from the button.

 Ewl_Widget *button;
 button = ewl_button_new();
 ewl_button_label_set(EWL_BUTTON(button), "Button label");
 ewl_widget_show(button);


Data Structures

struct  Ewl_Button
 A simple Ewl_Widget to provide for a clickable button in the UI. More...

Defines

#define EWL_BUTTON(button)   ((Ewl_Button *) button)
#define EWL_BUTTON_IS(w)   (ewl_widget_type_is(EWL_WIDGET(w), EWL_BUTTON_TYPE))
#define EWL_BUTTON_TYPE   "button"

Typedefs

typedef Ewl_Button Ewl_Button

Functions

unsigned int ewl_button_alignment_get (Ewl_Button *b)
 Gets the alignment of the contents of the button.
void ewl_button_alignment_set (Ewl_Button *b, unsigned int align)
 Set the alignment of the contents of the button.
void ewl_button_cb_key_down (Ewl_Widget *w, void *ev, void *data)
unsigned int ewl_button_fill_policy_get (Ewl_Button *b)
 Retrieves the curernt file policy set on the button.
void ewl_button_fill_policy_set (Ewl_Button *b, unsigned int fill)
 Set the fill policy of the contents of the button.
const char * ewl_button_image_get (Ewl_Button *b)
 Get the image file used by the button.
void ewl_button_image_set (Ewl_Button *b, const char *file, const char *key)
 Set the image file file and the image key key to use.
void ewl_button_image_size_get (Ewl_Button *b, int *width, int *height)
 Get the size of the image inside the button.
void ewl_button_image_size_set (Ewl_Button *b, int width, int height)
 Set the size of the image inside the button.
int ewl_button_init (Ewl_Button *b)
 Initialize a button to starting values.
const char * ewl_button_label_get (Ewl_Button *b)
 Retrieve the label of the specified button.
void ewl_button_label_set (Ewl_Button *b, const char *l)
 Change the label of the specified button.
Ewl_Widgetewl_button_new (void)
 Allocate and initialize a new button.

Define Documentation

#define EWL_BUTTON ( button   )     ((Ewl_Button *) button)

Typecast a pointer to an Ewl_Button pointer.

#define EWL_BUTTON_IS (  )     (ewl_widget_type_is(EWL_WIDGET(w), EWL_BUTTON_TYPE))

Returns TRUE if the widget is an Ewl_Button, FALSE otherwise

#define EWL_BUTTON_TYPE   "button"

The type name for the Ewl_Button widget


Typedef Documentation

typedef struct Ewl_Button Ewl_Button

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


Function Documentation

unsigned int ewl_button_alignment_get ( Ewl_Button b  ) 

Gets the alignment of the contents of the button.

Parameters:
b,: The button to get the content alignment
Returns:
Returns no value.

void ewl_button_alignment_set ( Ewl_Button b,
unsigned int  align 
)

Set the alignment of the contents of the button.

Parameters:
b,: The button to set the content alignment
align,: The new alignment for button contents
Returns:
Returns no value.

void ewl_button_cb_key_down ( Ewl_Widget w,
void *  ev,
void *  data 
)

unsigned int ewl_button_fill_policy_get ( Ewl_Button b  ) 

Retrieves the curernt file policy set on the button.

Parameters:
b,: The button to get the content fill policy from
Returns:
Returns the current fill policy set on the button

void ewl_button_fill_policy_set ( Ewl_Button b,
unsigned int  fill 
)

Set the fill policy of the contents of the button.

Parameters:
b,: The button to set the content fill policy
fill,: The new fill policy for button contents
Returns:
Returns no value.

const char* ewl_button_image_get ( Ewl_Button b  ) 

Get the image file used by the button.

Parameters:
b,: The button to the the image file from
Returns:
Returns the image file used in the button or NULL on failure

void ewl_button_image_set ( Ewl_Button b,
const char *  file,
const char *  key 
)

Set the image file file and the image key key to use.

Parameters:
b,: The button to set the image on
file,: The file to use for the image
key,: The edje key to use for the image (or NULL if not using edje)
Returns:
Returns no value.

void ewl_button_image_size_get ( Ewl_Button b,
int *  width,
int *  height 
)

Get the size of the image inside the button.

Parameters:
b,: The button to get the image size on
width,: Where to put the width of the widget
height,: Where to put the height of the widget
Returns:
Returns no value.

void ewl_button_image_size_set ( Ewl_Button b,
int  width,
int  height 
)

Set the size of the image inside the button.

Parameters:
b,: The button to set the image size on
width,: The width of the image
height,: The height of the image
Returns:
Returns no value.

int ewl_button_init ( Ewl_Button b  ) 

Initialize a button to starting values.

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

const 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,
const 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 ( void   ) 

Allocate and initialize a new button.

Returns:
Returns NULL on failure, a pointer to a new button on success


Copyright © Enlightenment.org

Enlightened Widget Library Documentation Generated: Sun Sep 27 01:49:46 2009