NbtkButton

NbtkButton — Button widget

Synopsis

                    NbtkButton;
NbtkWidget *        nbtk_button_new                     (void);
NbtkWidget *        nbtk_button_new_with_label          (const gchar *text);
const gchar *       nbtk_button_get_label               (NbtkButton *button);
void                nbtk_button_set_label               (NbtkButton *button,
                                                         const gchar *text);
void                nbtk_button_set_toggle_mode         (NbtkButton *button,
                                                         gboolean toggle);
gboolean            nbtk_button_get_toggle_mode         (NbtkButton *button);
void                nbtk_button_set_checked             (NbtkButton *button,
                                                         gboolean checked);
gboolean            nbtk_button_get_checked             (NbtkButton *button);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----ClutterActor
               +----NbtkWidget
                     +----NbtkBin
                           +----NbtkButton

Implemented Interfaces

NbtkButton implements ClutterScriptable, NbtkStylable and ClutterContainer.

Properties

  "checked"                  gboolean              : Read / Write
  "label"                    gchar*                : Read / Write
  "toggle-mode"              gboolean              : Read / Write
  "transition-duration"      gint                  : 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

NbtkButton

typedef struct _NbtkButton NbtkButton;

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


nbtk_button_new ()

NbtkWidget *        nbtk_button_new                     (void);

Create a new button

Returns :

a new NbtkButton

nbtk_button_new_with_label ()

NbtkWidget *        nbtk_button_new_with_label          (const gchar *text);

Create a new NbtkButton with the specified label

text :

text to set the label to

Returns :

a new NbtkButton

nbtk_button_get_label ()

const gchar *       nbtk_button_get_label               (NbtkButton *button);

Get the text displayed on the button

button :

a NbtkButton

Returns :

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

nbtk_button_set_label ()

void                nbtk_button_set_label               (NbtkButton *button,
                                                         const gchar *text);

Sets the text displayed on the button

button :

a Nbtkbutton

text :

text to set the label to

nbtk_button_set_toggle_mode ()

void                nbtk_button_set_toggle_mode         (NbtkButton *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 Nbtkbutton

toggle :

TRUE or FALSE

nbtk_button_get_toggle_mode ()

gboolean            nbtk_button_get_toggle_mode         (NbtkButton *button);

Get the toggle mode status of the button.

button :

a NbtkButton

Returns :

TRUE if toggle mode is set, otherwise FALSE

nbtk_button_set_checked ()

void                nbtk_button_set_checked             (NbtkButton *button,
                                                         gboolean checked);

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

button :

a Nbtkbutton

checked :

TRUE or FALSE

nbtk_button_get_checked ()

gboolean            nbtk_button_get_checked             (NbtkButton *button);

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

button :

a NbtkButton

Returns :

TRUE if the button is checked, or FALSE if not

Property Details

The "checked" property

  "checked"                  gboolean              : Read / Write

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

Default value: FALSE


The "label" property

  "label"                    gchar*                : Read / Write

Label of the button.

Default value: NULL


The "toggle-mode" property

  "toggle-mode"              gboolean              : Read / Write

Enable or disable toggling.

Default value: FALSE


The "transition-duration" property

  "transition-duration"      gint                  : Read / Write

Duration of the state transition effect.

Allowed values: >= 0

Default value: 120

Signal Details

The "clicked" signal

void                user_function                      (NbtkButton *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.