/** * cb_button_get_text: * @self: a #CbButton * * Get the text displayed on the button * * Returns: the button's text. This must not be freed by the application. */ G_CONST_RETURN gchar * cb_button_get_text (CbButton *self) { g_return_val_if_fail (CB_IS_BUTTON (self), NULL); return self->priv->text; }
/** * cb_button_set_text_color: * @self: a #CbButton * @color: the #ClutterColor to use as the color for the button text * * Set the color of the text on the button */ void cb_button_set_text_color (CbButton *self, const ClutterColor *color) { g_return_if_fail (CB_IS_BUTTON (self)); clutter_text_set_color (CLUTTER_TEXT (self->priv->label), color); }
/** * cb_button_set_background_color: * @self: a #CbButton * @color: the #ClutterColor to use for the button's background * * Set the color of the button's background */ void cb_button_set_background_color (CbButton *self, const ClutterColor *color) { g_return_if_fail (CB_IS_BUTTON (self)); clutter_box_set_color (CLUTTER_BOX (self->priv->child), color); }
/** * cb_button_set_background_color: * @self: a #CbButton * @color: the #ClutterColor to use for the button's background * * Set the color of the button's background */ void cb_button_set_background_color (CbButton *self, const ClutterColor *color) { g_return_if_fail (CB_IS_BUTTON (self)); clutter_actor_set_background_color (self->priv->child, color); }
/** * cb_button_set_text: * @self: a #CbButton * @text: the text to display on the button * * Set the text on the button */ void cb_button_set_text (CbButton *self, const gchar *text) { CbButtonPrivate *priv; /* public API should check its arguments; * see also g_return_val_if_fail for functions which * return a value */ g_return_if_fail (CB_IS_BUTTON (self)); priv = self->priv; g_free (priv->text); if (text) priv->text = g_strdup (text); else priv->text = g_strdup (""); /* call a function on the ClutterText inside the layout */ clutter_text_set_text (CLUTTER_TEXT (priv->label), priv->text); }