Top | Description | Object Hierarchy | Implemented Interfaces | Properties | Signals | ![]() |
![]() |
![]() |
![]() |
struct StButton; struct StButtonClass; StWidget * st_button_new (void
); StWidget * st_button_new_with_label (const gchar *text
); const gchar * st_button_get_label (StButton *button
); void st_button_set_label (StButton *button
,const gchar *text
); void st_button_set_toggle_mode (StButton *button
,gboolean toggle
); gboolean st_button_get_toggle_mode (StButton *button
); void st_button_set_checked (StButton *button
,gboolean checked
); gboolean st_button_get_checked (StButton *button
); void st_button_fake_release (StButton *button
); enum StButtonMask; void st_button_set_button_mask (StButton *button
,StButtonMask mask
); StButtonMask st_button_get_button_mask (StButton *button
);
GObject +----GInitiallyUnowned +----ClutterActor +----StWidget +----StBin +----StButton
StButton implements ClutterContainer, ClutterScriptable, ClutterAnimatable and AtkImplementorIface.
"button-mask" StButtonMask : Read / Write "checked" gboolean : Read / Write "label" gchar* : Read / Write "pressed" gboolean : Read "toggle-mode" gboolean : Read / Write
A button widget with support for either a text label or icon, toggle mode and transitions effects between states.
struct StButton;
The contents of this structure is private and should only be accessed using the provided API.
struct StButtonClass { StBinClass parent_class; /* vfuncs, not signals */ void (* transition) (StButton *button); /* signals */ void (* clicked) (StButton *button); };
StWidget * st_button_new_with_label (const gchar *text
);
Create a new StButton with the specified label
|
text to set the label to |
Returns : |
a new StButton |
const gchar * st_button_get_label (StButton *button
);
Get the text displayed on the button
|
a StButton |
Returns : |
the text for the button. This must not be freed by the application |
void st_button_set_label (StButton *button
,const gchar *text
);
Sets the text displayed on the button
|
a Stbutton |
|
text to set the label to |
void st_button_set_toggle_mode (StButton *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.
|
a Stbutton |
|
TRUE or FALSE
|
gboolean st_button_get_toggle_mode (StButton *button
);
Get the toggle mode status of the button.
|
a StButton |
Returns : |
TRUE if toggle mode is set, otherwise FALSE
|
void st_button_set_checked (StButton *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
.
|
a Stbutton |
|
TRUE or FALSE
|
gboolean st_button_get_checked (StButton *button
);
Get the state of the button that is in toggle mode.
|
a StButton |
Returns : |
TRUE if the button is checked, or FALSE if not |
void st_button_fake_release (StButton *button
);
If this widget is holding a pointer grab, this function will will ungrab it, and reset the pressed state. The effect is similar to if the user had released the mouse button, but without emitting the clicked signal.
This function is useful if for example you want to do something after the user is holding the mouse button for a given period of time, breaking the grab.
|
an StButton |
typedef enum { ST_BUTTON_ONE = (1 << 0), ST_BUTTON_TWO = (1 << 1), ST_BUTTON_THREE = (1 << 2), } StButtonMask;
A mask representing which mouse buttons an StButton responds to.
void st_button_set_button_mask (StButton *button
,StButtonMask mask
);
Sets which mouse buttons button
emits "clicked" for.
|
a Stbutton |
|
the mask of mouse buttons that button responds to |
StButtonMask st_button_get_button_mask (StButton *button
);
Gets the mask of mouse buttons that button
emits the
"clicked" signal for.
"button-mask"
property"button-mask" StButtonMask : Read / Write
Which buttons trigger the 'clicked' signal.
Default value: ST_BUTTON_ONE
"checked"
property "checked" gboolean : Read / Write
Indicates if a toggle button is "on" or "off".
Default value: FALSE
"pressed"
property "pressed" gboolean : Read
Indicates if the button is pressed in.
Default value: FALSE
"clicked"
signalvoid user_function (StButton *button,
gint clicked_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 |
|
the mouse button that was used |
|
user data set when the signal handler was connected. |