HildonTimePicker

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

Synopsis




            HildonTimePicker;
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);

Object Hierarchy


  GObject
   +----GInitiallyUnowned
         +----GtkObject
               +----GtkWidget
                     +----GtkContainer
                           +----GtkBin
                                 +----GtkWindow
                                       +----GtkDialog
                                             +----HildonTimePicker

Implemented Interfaces

HildonTimePicker implements GtkBuildable and AtkImplementorIface.

Properties


  "minutes"              guint                 : Read / Write

Style Properties


  "arrow-height"         guint                 : Read
  "arrow-width"          guint                 : Read

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.

Example 9. HildonTimePicker example


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

HildonTimePicker

typedef struct _HildonTimePicker HildonTimePicker;


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

Property Details

The "minutes" property

  "minutes"              guint                 : Read / Write

Currently selected time in minutes since midnight.

Allowed values: <= 1440

Default value: 0

Style Property Details

The "arrow-height" style property

  "arrow-height"         guint                 : Read

Increase/decrease arrows height.

Default value: 26


The "arrow-width" style property

  "arrow-width"          guint                 : Read

Increase/decrease arrows width.

Default value: 26

See Also

HildonTimeEditor