X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=examples%2Fhildon-picker-button-example.c;h=4d10fbf509773d2dd570ec815441becd7c389f6e;hb=24f710b85e9001862a4a9f54859ac6ba98a04ffb;hp=6b6c92f9d1d4fd64fc2b0128635dbda811bf708e;hpb=2849117e08726a65ab48d6701ecf33b7b02d544c;p=hildon diff --git a/examples/hildon-picker-button-example.c b/examples/hildon-picker-button-example.c index 6b6c92f..4d10fbf 100644 --- a/examples/hildon-picker-button-example.c +++ b/examples/hildon-picker-button-example.c @@ -14,14 +14,9 @@ * */ -#include -#include - -#include "hildon-program.h" -#include "hildon-stackable-window.h" - -#include "hildon-picker-button.h" -#include "hildon-touch-selector.h" +#include +#include +#include static void on_picker_value_changed (HildonPickerButton * button, gpointer data) @@ -31,14 +26,14 @@ on_picker_value_changed (HildonPickerButton * button, gpointer data) } int -main (int argc, char **args) +main (int argc, char **argv) { HildonProgram *program = NULL; GtkWidget *window = NULL; GtkWidget *button; GtkWidget *selector; - gtk_init (&argc, &args); + hildon_gtk_init (&argc, &argv); program = hildon_program_get_instance (); g_set_application_name ("hildon-picker-button-example"); @@ -47,7 +42,7 @@ main (int argc, char **args) gtk_window_set_default_size (GTK_WINDOW (window), 300, 200); hildon_program_add_window (program, HILDON_WINDOW (window)); - button = hildon_picker_button_new (HILDON_BUTTON_WITH_VERTICAL_VALUE); + button = hildon_picker_button_new (HILDON_SIZE_AUTO, HILDON_BUTTON_ARRANGEMENT_VERTICAL); selector = hildon_touch_selector_new_text (); hildon_button_set_title (HILDON_BUTTON (button), "Continent"); @@ -58,6 +53,10 @@ main (int argc, char **args) hildon_touch_selector_append_text (HILDON_TOUCH_SELECTOR (selector), "Australia"); + /* Select any item, just to show that during selector's setting, the currently selected + item will be displayed in the button's value. */ + hildon_touch_selector_set_active (HILDON_TOUCH_SELECTOR (selector), 0, 2); + hildon_picker_button_set_selector (HILDON_PICKER_BUTTON (button), HILDON_TOUCH_SELECTOR (selector));