Etk
Main Page Object Hierarchy Data Structures Related Pages
Etk

Etk_Radio_Button


Detailed Description

The Etk_Radio_Button widget is a toggle-button that belongs to a group in which only one button can be active.

radio_button.png
When a radio-button is activated, the other radio-buttons of the same group are deactivated. This way, in a group, only one radio-button can be active.
Radio-buttons are used when the user has to make a choice between several options.

To create several radio-buttons belonging to the same group, you can first call etk_radio_button_new_with_label() to create the first radio-button, and then use etk_radio_button_new_with_label_from_widget() to create the other radio buttons of the group. For example:

 Etk_Widget *radio_buttons[3];

 //Creates 3 radio-buttons belonging to the same group
 radio_buttons[0] = etk_radio_button_new_with_label("Option 1");
 radio_buttons[1] = etk_radio_button_new_with_label_from_widget("Option 2", ETK_RADIO_BUTTON(radio_buttons[0]));
 radio_buttons[2] = etk_radio_button_new_with_label_from_widget("Option 3", ETK_RADIO_BUTTON(radio_buttons[0]));

Object Hierarchy:
  • Etk_Object
    • Etk_Widget
      • Etk_Container
        • Etk_Bin
          • Etk_Button
            • Etk_Toggle_Button
              • Etk_Radio_Button
Properties:
  • "group": The group of the radio-button
    • Type: Pointer (Evas_List **)
    • Access: Read/Write
    • Default Value: NULL


Data Structures

struct  Etk_Radio_Button
 [Widget] A toggle-button that belongs to a group in which only one button can be active More...

Defines

#define ETK_RADIO_BUTTON_TYPE   (etk_radio_button_type_get())
#define ETK_RADIO_BUTTON(obj)   (ETK_OBJECT_CAST((obj), ETK_RADIO_BUTTON_TYPE, Etk_Radio_Button))
#define ETK_IS_RADIO_BUTTON(obj)   (ETK_OBJECT_RADIO_TYPE((obj), ETK_RADIO_BUTTON_TYPE))

Functions

Etk_Widget * etk_radio_button_new (Evas_List **group)
 Creates a new radio-button.
Etk_Widget * etk_radio_button_new_from_widget (Etk_Radio_Button *radio_button)
 Creates a new radio-button. It will use the group of another radio-button.
Etk_Widget * etk_radio_button_new_with_label (const char *label, Evas_List **group)
 Creates a new radio-button with a label.
Etk_Widget * etk_radio_button_new_with_label_from_widget (const char *label, Etk_Radio_Button *radio_button)
 Creates a new radio-button with a label. It will use the group of another radio-button.
void etk_radio_button_group_set (Etk_Radio_Button *radio_button, Evas_List **group)
 Sets the group of the radio-button.
Evas_List ** etk_radio_button_group_get (Etk_Radio_Button *radio_button)
 Gets the group of the radio-button.


Define Documentation

#define ETK_RADIO_BUTTON_TYPE   (etk_radio_button_type_get())

Gets the type of a radio button

#define ETK_RADIO_BUTTON ( obj   )     (ETK_OBJECT_CAST((obj), ETK_RADIO_BUTTON_TYPE, Etk_Radio_Button))

Casts the object to an Etk_Radio_Button

#define ETK_IS_RADIO_BUTTON ( obj   )     (ETK_OBJECT_RADIO_TYPE((obj), ETK_RADIO_BUTTON_TYPE))

Checks if the object is an Etk_Radio_Button


Function Documentation

Etk_Widget * etk_radio_button_new ( Evas_List **  group  ) 

Creates a new radio-button.

Parameters:
group the group to which the radio-button will be added (NULL if the radio-button should create its own group)
Returns:
Returns the new radio-button widget

Etk_Widget * etk_radio_button_new_from_widget ( Etk_Radio_Button *  radio_button  ) 

Creates a new radio-button. It will use the group of another radio-button.

Parameters:
radio_button the radio-button whose group will be used by the new radio-button
Returns:
Returns the new radio-button widget

Etk_Widget * etk_radio_button_new_with_label ( const char *  label,
Evas_List **  group 
)

Creates a new radio-button with a label.

Parameters:
label the label
group the group to which the radio-button will be added (NULL if the radio-button should create its own group)
Returns:
Returns the new radio-button widget

Etk_Widget * etk_radio_button_new_with_label_from_widget ( const char *  label,
Etk_Radio_Button *  radio_button 
)

Creates a new radio-button with a label. It will use the group of another radio-button.

Parameters:
label the label
radio_button the radio-button whose group will be used by the new radio-button
Returns:
Returns the new radio-button widget

void etk_radio_button_group_set ( Etk_Radio_Button *  radio_button,
Evas_List **  group 
)

Sets the group of the radio-button.

Parameters:
radio_button a radio-button
group the group to use

Evas_List ** etk_radio_button_group_get ( Etk_Radio_Button *  radio_button  ) 

Gets the group of the radio-button.

Parameters:
radio_button a radio-button
Returns:
Returns the group used by the radio-button