![]() |
![]() |
![]() |
Netbook Toolkit Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties | Signals |
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
);
GObject +----GInitiallyUnowned +----ClutterActor +----NbtkWidget +----NbtkBin +----NbtkButton
"checked" gboolean : Read / Write "label" gchar* : Read / Write "toggle-mode" gboolean : Read / Write "transition-duration" gint : Read / Write
A button widget with support for either a text label or icon, toggle mode and transitions effects between states.
typedef struct _NbtkButton NbtkButton;
The contents of this structure is private and should only be accessed using the provided API.
NbtkWidget * nbtk_button_new (void
);
Create a new button
Returns : |
a new NbtkButton |
NbtkWidget * nbtk_button_new_with_label (const gchar *text
);
Create a new NbtkButton with the specified label
|
text to set the label to |
Returns : |
a new NbtkButton |
const gchar * nbtk_button_get_label (NbtkButton *button
);
Get the text displayed on the button
|
a NbtkButton |
Returns : |
the text for the button. This must not be freed by the application |
void nbtk_button_set_label (NbtkButton *button
,const gchar *text
);
Sets the text displayed on the button
|
a Nbtkbutton |
|
text to set the label to |
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.
gboolean nbtk_button_get_toggle_mode (NbtkButton *button
);
Get the toggle mode status of the button.
|
a NbtkButton |
Returns : |
TRUE if toggle mode is set, otherwise FALSE |
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.
gboolean nbtk_button_get_checked (NbtkButton *button
);
Get the state of the button that is in toggle mode.
|
a NbtkButton |
Returns : |
TRUE if the button is checked, or FALSE if not |
"checked"
property"checked" gboolean : Read / Write
Indicates if a toggle button is "on" or "off".
Default value: FALSE
"toggle-mode"
property"toggle-mode" gboolean : Read / Write
Enable or disable toggling.
Default value: FALSE
"transition-duration"
property"transition-duration" gint : Read / Write
Duration of the state transition effect.
Allowed values: >= 0
Default value: 120
"clicked"
signalvoid 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.
|
the object that received the signal |
|
user data set when the signal handler was connected. |