| clutk Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Implemented Interfaces | Properties | Signals | ||||
CtkButton; CtkButtonClass; CtkButtonPrivate; ClutterActor * ctk_button_new (CtkOrientation orientation); void ctk_button_set_label (CtkButton *button,const gchar *label); const gchar * ctk_button_get_label (CtkButton *button); void ctk_button_set_image (CtkButton *button,CtkImage *image); CtkImage * ctk_button_get_image (CtkButton *button); void ctk_button_set_text (CtkButton *button,CtkText *text); CtkText * ctk_button_get_text (CtkButton *button); void ctk_button_set_orientation (CtkButton *button,CtkOrientation orient); CtkOrientation ctk_button_get_orientation (CtkButton *button);
GObject +----GInitiallyUnowned +----ClutterActor +----CtkActor +----CtkBin +----CtkButton
"image" CtkImage* : Read / Write "label" gchar* : Read / Write "orientation" gint : Read / Write
CtkButton is used to present a classical "button" interface and to provide appropriate signals when it is clicked on Typically a CtkButton will/can hold a CtkText and CtkImage at the same time.
typedef struct {
CtkBinClass parent_class;
/*< signals />*/
void (*clicked) (CtkButton *item);
void (*show_context_menu) (CtkButton *item, guint32 event_time);
} CtkButtonClass;
ClutterActor * ctk_button_new (CtkOrientation orientation);
Creates a new CtkButton object
|
a CtkOrientation defining horizontal or virtical orientation |
Returns : |
A new CtkButton object |
void ctk_button_set_label (CtkButton *button,const gchar *label);
Sets the label of the button to label
This will clear any previously set labels
|
a CtkButton |
|
A string containing the label text |
const gchar * ctk_button_get_label (CtkButton *button);
This will fetch the text from the label of button, if the label has not been
set with ctk_button_set_label() then this will return NULL
|
a CtkButton |
Returns : |
gchar string representing the text or NULL |
void ctk_button_set_image (CtkButton *button,CtkImage *image);
Attaches image to button with respect to the buttons Orientation
|
A CtkButton |
|
A CtkImage to be attached to button
|
CtkImage * ctk_button_get_image (CtkButton *button);
returns the GtkImage that is attached to button. see also: ctk_button_set_image()
|
A CtkButton |
Returns : |
a CtkImage; |
void ctk_button_set_text (CtkButton *button,CtkText *text);
Attaches text to button with respect to button orientation
|
A CtkButton |
|
a CtkText object to attach to button
|
CtkText * ctk_button_get_text (CtkButton *button);
gets the CtkText object that is attached to button. see also: ctk_button_set_text()
|
A CtkButton |
Returns : |
a CtkText object; |
void ctk_button_set_orientation (CtkButton *button,CtkOrientation orient);
CtkButton can be orientated either horizontaly or vertically and can be set / using this function, CTK_ORIENTATION_HORIZONTAL will prefer to line label/image / in a row, whist CTK_ORIENTATION_VERTICAL will prefer to stack in a column. see also: CtkOrientation
|
A CtkButton |
|
A CtkOrientation regarding button orientation
|
CtkOrientation ctk_button_get_orientation (CtkButton *button);
Returns the orientation of button. see also: ctk_button_set_orientation()
|
A CtkButton |
Returns : |
a CtkOrientation object |
"label" property"label" gchar* : Read / Write
Text of the label inside the button.
Default value: NULL
"orientation" property"orientation" gint : Read / Write
Orientation of the button and it's contents.
Allowed values: [0,1]
Default value: 0