HildonTimePicker

HildonTimePicker — A dialog popup widget which lets the user set the time

Synopsis




            HildonTimePickerPrivate;
GtkWidget*  hildon_time_picker_new          (GtkWindow *parent);
void        hildon_time_picker_set_time     (HildonTimePicker *picker,
                                             guint hours,
                                             guint minutes);
void        hildon_time_picker_get_time     (HildonTimePicker *picker,
                                             guint *hours,
                                             guint *minutes);

Description

HildonTimePicker is a dialog popup widget which lets the user set the time, using up/down arrows on hours and minutes. There are two arrows for minutes, so that minutes can be added also in 10 min increments.This widget is mainly used as a part of HildonTimeEditor implementation.

...
parent = gtk_widget_get_ancestor (GTK_WIDGET (editor), GTK_TYPE_WINDOW);
picker = hildon_time_picker_new (GTK_WINDOW (parent));

hildon_time_editor_get_time (editor, &h, &m, &s);
hildon_time_picker_set_time( HILDON_TIME_PICKER( picker ), h, m );

result = gtk_dialog_run( GTK_DIALOG ( picker ) );
switch (result)
{
case GTK_RESPONSE_OK:
case GTK_RESPONSE_ACCEPT:
    hildon_time_picker_get_time(HILDON_TIME_PICKER( picker ), &h, &m );
    foo_set_time(h,m);
break;
default:
break;
}

gtk_widget_destroy( picker );
...

Details

HildonTimePickerPrivate

typedef struct _HildonTimePickerPrivate HildonTimePickerPrivate;


hildon_time_picker_new ()

GtkWidget*  hildon_time_picker_new          (GtkWindow *parent);

HildonTimePicker shows time picker dialog. The close button is placed in the dialog's action area and time picker is placed in dialogs vbox. The actual time picker consists of two GtkLabel fields - one for hours and one for minutes - and an AM/PM button. A colon (:) is placed between hour and minute fields.

parent : parent window
Returns : pointer to a new HildonTimePicker widget.

hildon_time_picker_set_time ()

void        hildon_time_picker_set_time     (HildonTimePicker *picker,
                                             guint hours,
                                             guint minutes);

Sets the time of the HildonTimePicker widget.

picker : the HildonTimePicker widget
hours : hours
minutes : minutes

hildon_time_picker_get_time ()

void        hildon_time_picker_get_time     (HildonTimePicker *picker,
                                             guint *hours,
                                             guint *minutes);

Gets the time of the HildonTimePicker widget.

picker : the HildonTimePicker widget
hours : hours
minutes : minutes

See Also

HildonTimeEditor