MxButton

MxButton — Button widget

Synopsis

struct              MxButton;
ClutterActor *      mx_button_new                       (void);
ClutterActor *      mx_button_new_with_label            (const gchar *text);
const gchar *       mx_button_get_label                 (MxButton *button);
void                mx_button_set_label                 (MxButton *button,
                                                         const gchar *text);
void                mx_button_set_is_toggle             (MxButton *button,
                                                         gboolean toggle);
gboolean            mx_button_get_is_toggle             (MxButton *button);
void                mx_button_set_toggled               (MxButton *button,
                                                         gboolean toggled);
gboolean            mx_button_get_toggled               (MxButton *button);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----ClutterActor
               +----MxWidget
                     +----MxBin
                           +----MxButton

Implemented Interfaces

MxButton implements ClutterScriptable, MxStylable, ClutterContainer and MxFocusable.

Properties

  "is-toggle"                gboolean              : Read / Write
  "label"                    gchar*                : Read / Write
  "toggled"                  gboolean              : Read / Write

Signals

  "clicked"                                        : Run Last

Description

A button widget with support for either a text label or icon, toggle mode and transitions effects between states.

Details

struct MxButton

struct MxButton;

The contents of this structure is private and should only be accessed using the provided API.


mx_button_new ()

ClutterActor *      mx_button_new                       (void);

Create a new button

Returns :

a new MxButton

mx_button_new_with_label ()

ClutterActor *      mx_button_new_with_label            (const gchar *text);

Create a new MxButton with the specified label

text :

text to set the label to

Returns :

a new MxButton

mx_button_get_label ()

const gchar *       mx_button_get_label                 (MxButton *button);

Get the text displayed on the button

button :

a MxButton

Returns :

the text for the button. This must not be freed by the application

mx_button_set_label ()

void                mx_button_set_label                 (MxButton *button,
                                                         const gchar *text);

Sets the text displayed on the button

button :

a MxButton

text :

text to set the label to

mx_button_set_is_toggle ()

void                mx_button_set_is_toggle             (MxButton *button,
                                                         gboolean toggle);

Enables or disables toggle mode for the button. In toggle mode, the active state will be "toggled" when the user clicks the button.

button :

a MxButton

toggle :

TRUE or FALSE

mx_button_get_is_toggle ()

gboolean            mx_button_get_is_toggle             (MxButton *button);

Get the toggle mode status of the button.

button :

a MxButton

Returns :

TRUE if toggle mode is set, otherwise FALSE

mx_button_set_toggled ()

void                mx_button_set_toggled               (MxButton *button,
                                                         gboolean toggled);

Sets the toggled state of the button. This is only really useful if the button has toggle-mode mode set to TRUE.

button :

a MxButton

toggled :

TRUE or FALSE

mx_button_get_toggled ()

gboolean            mx_button_get_toggled               (MxButton *button);

Get the state of the button that is in toggle mode.

button :

a MxButton

Returns :

TRUE if the button is toggled, or FALSE if not

Property Details

The "is-toggle" property

  "is-toggle"                gboolean              : Read / Write

Enable or disable toggling.

Default value: FALSE


The "label" property

  "label"                    gchar*                : Read / Write

Label of the button.

Default value: NULL


The "toggled" property

  "toggled"                  gboolean              : Read / Write

Indicates if a toggle button is "on" or "off".

Default value: FALSE

Signal Details

The "clicked" signal

void                user_function                      (MxButton *button,
                                                        gpointer  user_data)      : Run Last

Emitted when the user activates the button, either with a mouse press and release or with the keyboard.

button :

the object that received the signal

user_data :

user data set when the signal handler was connected.