hildon 2.1.24 Reference Manual | ||||
---|---|---|---|---|
HildonPickerButtonHildonPickerButton — A button that launches a HildonPickerDialog and displays the selected item |
HildonPickerButton; GtkWidget* hildon_picker_button_new (HildonSizeType size, HildonButtonArrangement arrangement); void hildon_picker_button_set_selector (HildonPickerButton *button, HildonTouchSelector *selector); HildonTouchSelector* hildon_picker_button_get_selector (HildonPickerButton *button); void hildon_picker_button_set_active (HildonPickerButton *button, gint index); gint hildon_picker_button_get_active (HildonPickerButton *button); const gchar* hildon_picker_button_get_done_button_text (HildonPickerButton *button); void hildon_picker_button_set_done_button_text (HildonPickerButton *button, const gchar *done_button_text);
GObject +----GInitiallyUnowned +----GtkObject +----GtkWidget +----GtkContainer +----GtkBin +----GtkButton +----HildonButton +----HildonPickerButton +----HildonDateButton +----HildonTimeButton
"done-button-text" gchar* : Read / Write "touch-selector" HildonTouchSelector* : Read / Write
HildonPickerButton is a widget that lets the user select a particular item from a list. Visually, it's a button with title and value labels that brings up a HildonPickerDialog. The user can then use this dialog to choose an item, which will be displayed in the value label of the button.
You should create your own HildonTouchSelector at convenience and set it
to the HildonPickerButton with hildon_picker_button_set_selector()
. For
the common use cases of buttons to select date and time, you can use HildonDateButton
and HildonTimeButton.
GtkWidget* hildon_picker_button_new (HildonSizeType size, HildonButtonArrangement arrangement);
Creates a new HildonPickerButton. See hildon_button_new()
for details on the
parameters.
size : |
One of HildonSizeType, specifying the size of the new button. |
arrangement : |
one of HildonButtonArrangement, specifying the placement of the labels. |
Returns : | a newly created HildonPickerButton |
void hildon_picker_button_set_selector (HildonPickerButton *button, HildonTouchSelector *selector);
Sets selector
as the HildonTouchSelector to be shown in the
HildonPickerDialog that button
brings up.
button : |
a HildonPickerButton |
selector : |
a HildonTouchSelector |
HildonTouchSelector* hildon_picker_button_get_selector (HildonPickerButton *button);
Retrieves the HildonTouchSelector associated to button
.
button : |
a HildonPickerButton |
Returns : | a HildonTouchSelector |
void hildon_picker_button_set_active (HildonPickerButton *button, gint index);
Sets the active item of the HildonTouchSelector associated to
button
to index
. If the selector has several columns, only the
first one is used.
button : |
a HildonPickerButton |
index : |
the index of the item to select, or -1 to have no active item |
gint hildon_picker_button_get_active (HildonPickerButton *button);
Returns the index of the currently active item, or -1 if there's no active item. If the selector has several columns, only the first one is used.
button : |
a HildonPickerButton |
Returns : | an integer which is the index of the currently active item, or -1 if there's no active item. |
const gchar* hildon_picker_button_get_done_button_text (HildonPickerButton *button);
Gets the text used in the HildonPickerDialog that is launched by
button
. If no custom text is set, then NULL
is returned.
button : |
a HildonPickerButton |
Returns : | the custom string to be used, or NULL if the default
"done-button-text" is to be used.
|
void hildon_picker_button_set_done_button_text (HildonPickerButton *button, const gchar *done_button_text);
Sets a custom string to be used in the \"done\" button in the HildonPickerDialog launched. If not set, the default HildonPickerButton::done-button-text property value will be used.
button : |
a HildonPickerButton |
done_button_text : |
a string |
"done-button-text"
property"done-button-text" gchar* : Read / Write
The text for the "done" button in the dialog launched.
Default value: NULL
"touch-selector"
property"touch-selector" HildonTouchSelector* : Read / Write
HildonTouchSelector widget to be launched on button clicked.
"value-changed"
signalvoid user_function (HildonPickerButton *widget, gpointer user_data) : Run Last / Action
The ::value-changed signal is emitted each time the user chooses a different item from the HildonTouchSelector related, and the value label gets updated.
widget : |
the widget that received the signal |
user_data : |
user data set when the signal handler was connected. |