|  |  |  | Mx Toolkit Reference Manual |  | 
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Implemented Interfaces | Properties | Signals | ||||
struct MxButton; struct MxButtonClass; 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); const gchar * mx_button_get_icon_name (MxButton *button); void mx_button_set_icon_name (MxButton *button,const gchar *icon_name); guint mx_button_get_icon_size (MxButton *button); void mx_button_set_icon_size (MxButton *button,guint icon_size); 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); void mx_button_set_action (MxButton *button,MxAction *action); MxAction * mx_button_get_action (MxButton *button); void mx_button_set_icon_position (MxButton *button,MxPosition position); MxPosition mx_button_get_icon_position (MxButton *button); void mx_button_set_icon_visible (MxButton *button,gboolean visible); gboolean mx_button_get_icon_visible (MxButton *button); void mx_button_set_label_visible (MxButton *button,gboolean visible); gboolean mx_button_get_label_visible (MxButton *button);
GObject +----GInitiallyUnowned +----ClutterActor +----MxWidget +----MxBin +----MxButton
MxButton implements ClutterContainer, ClutterScriptable, ClutterAnimatable, AtkImplementorIface, MxStylable and MxFocusable.
"action" MxAction* : Read / Write "icon-name" gchar* : Read / Write "icon-position" MxPosition : Read / Write "icon-size" guint : Read / Write "icon-visible" gboolean : Read / Write "is-toggle" gboolean : Read / Write "label" gchar* : Read / Write "label-visible" gboolean : Read / Write "toggled" gboolean : Read / Write
A button widget with support for either a text label or icon, toggle mode and transitions effects between states.
struct MxButton;
The contents of this structure is private and should only be accessed using the provided API.
struct MxButtonClass {
  MxBinClass parent_class;
  /* signals */
  void     (* clicked)    (MxButton          *button);
  /* padding for future expansion */
  void (*_padding_0) (void);
  void (*_padding_1) (void);
  void (*_padding_2) (void);
  void (*_padding_3) (void);
  void (*_padding_4) (void);
};
ClutterActor *      mx_button_new_with_label            (const gchar *text);
Create a new MxButton with the specified label
| 
 | text to set the label to | 
| Returns : | a new MxButton | 
const gchar *       mx_button_get_label                 (MxButton *button);
Get the text displayed on the button
| 
 | a MxButton | 
| Returns : | the text for the button. This must not be freed by the application | 
void mx_button_set_label (MxButton *button,const gchar *text);
Sets the text displayed on the button
| 
 | a MxButton | 
| 
 | text to set the label to | 
const gchar *       mx_button_get_icon_name             (MxButton *button);
Get the icon-name being used on the button.
| 
 | a MxButton | 
| Returns : | the icon-name. This must not be freed by the application. NULLif
no icon has been set | 
Since 1.2
void mx_button_set_icon_name (MxButton *button,const gchar *icon_name);
Sets the icon-name used to display an icon on the button. Setting NULL
will remove the icon name, or resort to the icon-name set in the current
style. Setting an icon name overrides any icon set in the style.
| 
 | a MxButton | 
| 
 | icon-name to use on the button. [allow-none] | 
Since 1.2
guint               mx_button_get_icon_size             (MxButton *button);
Retrieves the icon-size being used for the displayed icon inside the button.
| 
 | a MxButton | 
| Returns : | The icon-size being used for the button icon, in pixels | 
Since 1.2
void mx_button_set_icon_size (MxButton *button,guint icon_size);
Sets the icon-size to use for the icon displayed inside the button. This will
override the icon-size set in the style. Setting a value of 0 resets to the
size from the style.
| 
 | a MxButton | 
Since 1.2
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.
gboolean            mx_button_get_is_toggle             (MxButton *button);
Get the toggle mode status of the button.
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.
gboolean            mx_button_get_toggled               (MxButton *button);
Get the state of the button that is in toggle mode.
void mx_button_set_action (MxButton *button,MxAction *action);
Sets action as the action for button. Button will take its label and
icon from action.
Since 1.2
MxAction *          mx_button_get_action                (MxButton *button);
Retrieves the MxAction associated with button.
Since 1.2
void mx_button_set_icon_position (MxButton *button,MxPosition position);
Sets the icon position, relative to the text on the button.
| 
 | A MxButton | 
| 
 | A MxPosition | 
Since 1.2
MxPosition          mx_button_get_icon_position         (MxButton *button);
Retrieves the icon's relative position to the text.
| 
 | A MxButton | 
| Returns : | A MxPosition | 
Since 1.2
void mx_button_set_icon_visible (MxButton *button,gboolean visible);
Sets the visibility of the icon associated with the button's action.
Since 1.2
gboolean            mx_button_get_icon_visible          (MxButton *button);
Retrieves the visibility of the icon associated with the button's action.
Since 1.2
void mx_button_set_label_visible (MxButton *button,gboolean visible);
Sets the visibility of the text associated with the button's action.
Since 1.2
"icon-name" property"icon-name" gchar* : Read / Write
Icon name of the button.
Default value: NULL
"icon-position" property"icon-position" MxPosition : Read / Write
The position of the icon, relative to the text.
Default value: MX_POSITION_LEFT
"icon-size" property"icon-size" guint : Read / Write
The size to use for the button icon (in pixels).
Default value: 0
"icon-visible" property"icon-visible" gboolean : Read / Write
Whether to show the icon.
Default value: TRUE
"is-toggle" property"is-toggle" gboolean : Read / Write
Enable or disable toggling.
Default value: FALSE
"label-visible" property"label-visible" gboolean : Read / Write
Whether to show the label.
Default value: TRUE
"toggled" property"toggled" gboolean : Read / Write
Indicates if a toggle button is "on" or "off".
Default value: FALSE
"clicked" signalvoid                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.
| 
 | the object that received the signal | 
| 
 | user data set when the signal handler was connected. |