Etk
Main Page Object Hierarchy Data Structures Related Pages
Etk

Etk_Toggle_Button


Detailed Description

An Etk_Toggle_Button is a button that can be activated and deactivated by clicking on it. It is the base class of check and radio buttons.

toggle_button.png

Object Hierarchy:
  • Etk_Object
    • Etk_Widget
      • Etk_Container
        • Etk_Bin
          • Etk_Button
            • Etk_Toggle_Button
Signals:
  • "toggled": Emitted when the state of the toggle button is changed
    • Callback: void callback(Etk_Toggle_Button *button, void *data)
      • button: the toggle button that has been toggled
      • data: the user data set when the callback has been connected to the signal
Properties:
  • "active": Whether or not the toggle button is active
    • Type: Boolean
    • Access: Read/Write
    • Default Value: ETK_FALSE


Data Structures

struct  Etk_Toggle_Button
 [Widget] A button that can be activated/deactivated More...

Defines

#define ETK_TOGGLE_BUTTON_TYPE   (etk_toggle_button_type_get())
 Gets the type of a toggle button.
#define ETK_TOGGLE_BUTTON(obj)   (ETK_OBJECT_CAST((obj), ETK_TOGGLE_BUTTON_TYPE, Etk_Toggle_Button))
 Casts the object to an Etk_Toggle_Button.
#define ETK_IS_TOGGLE_BUTTON(obj)   (ETK_OBJECT_CHECK_TYPE((obj), ETK_TOGGLE_BUTTON_TYPE))
 Checks if the object is an Etk_Toggle_Button.

Functions

Etk_Widget * etk_toggle_button_new (void)
 Creates a new toggle button.
Etk_Widget * etk_toggle_button_new_with_label (const char *label)
 Creates a new toggle button with a label.
void etk_toggle_button_toggle (Etk_Toggle_Button *toggle_button)
 Toggles the toggle button.
void etk_toggle_button_active_set (Etk_Toggle_Button *toggle_button, Etk_Bool active)
 Sets whether the toggle button is active or not.
Etk_Bool etk_toggle_button_active_get (Etk_Toggle_Button *toggle_button)
 Gets the state of the toggle button.


Define Documentation

#define ETK_TOGGLE_BUTTON_TYPE   (etk_toggle_button_type_get())

Gets the type of a toggle button.

#define ETK_TOGGLE_BUTTON ( obj   )     (ETK_OBJECT_CAST((obj), ETK_TOGGLE_BUTTON_TYPE, Etk_Toggle_Button))

Casts the object to an Etk_Toggle_Button.

#define ETK_IS_TOGGLE_BUTTON ( obj   )     (ETK_OBJECT_CHECK_TYPE((obj), ETK_TOGGLE_BUTTON_TYPE))

Checks if the object is an Etk_Toggle_Button.


Function Documentation

Etk_Widget * etk_toggle_button_new ( void   ) 

Creates a new toggle button.

Returns:
Returns the new toggle-button widget

Etk_Widget * etk_toggle_button_new_with_label ( const char *  label  ) 

Creates a new toggle button with a label.

Parameters:
label the label
Returns:
Returns the new toggle-button widget

void etk_toggle_button_toggle ( Etk_Toggle_Button *  toggle_button  ) 

Toggles the toggle button.

Parameters:
toggle_button a toggle button

void etk_toggle_button_active_set ( Etk_Toggle_Button *  toggle_button,
Etk_Bool  active 
)

Sets whether the toggle button is active or not.

Parameters:
toggle_button a toggle button
active if active is ETK_TRUE, the toggle button will be activated. Otherwise, it will be deactivated

Etk_Bool etk_toggle_button_active_get ( Etk_Toggle_Button *  toggle_button  ) 

Gets the state of the toggle button.

Parameters:
toggle_button a toggle button
Returns:
Returns ETK_TRUE if the button is active, ETK_FALSE otherwise