Clock

../_images/clock-preview.png

Widget description

This is a digital clock widget.

In its default theme, it has a vintage “flipping numbers clock” appearance, which will animate sheets of individual algarisms individually as time goes by.

A newly created clock will fetch system’s time (already considering local time adjustments) to start with, and will tick accordingly. It may or may not show seconds.

Clocks have an edition mode. When in it, the sheets will display extra arrow indications on the top and bottom and the user may click on them to raise or lower the time values. After it’s told to exit edition mode, it will keep ticking with that new time set (it keeps the difference from local time).

Also, when under edition mode, user clicks on the cited arrows which are held for some time will make the clock to flip the sheet, thus editing the time, continuously and automatically for the user. The interval between sheet flips will keep growing in time, so that it helps the user to reach a time which is distant from the one set.

The time display is, by default, in military mode (24h), but an am/pm indicator may be optionally shown, too, when it will switch to 12h.

Emitted signals

  • changed - the clock’s user changed the time

Enumerations

Clock edit modes

efl.elementary.ELM_CLOCK_EDIT_DEFAULT

Default edit

efl.elementary.ELM_CLOCK_EDIT_HOUR_DECIMAL

Edit hours’ decimal

efl.elementary.ELM_CLOCK_EDIT_HOUR_UNIT

Edit hours’ unit

efl.elementary.ELM_CLOCK_EDIT_MIN_DECIMAL

Edit minutes’ decimal

efl.elementary.ELM_CLOCK_EDIT_MIN_UNIT

Edit minutes’ unit

efl.elementary.ELM_CLOCK_EDIT_SEC_DECIMAL

Edit seconds’ decimal

efl.elementary.ELM_CLOCK_EDIT_SEC_UNIT

Edit seconds’ unit

efl.elementary.ELM_CLOCK_EDIT_ALL

Edit all

Inheritance diagram

Inheritance diagram of Clock
class efl.elementary.Clock(Object parent, *args, **kwargs)

Bases: efl.elementary.__init__.LayoutClass

This is the class that actually implements the widget.

Parameters
  • parent (efl.evas.Object) – The parent object

  • **kwargs – All the remaining keyword arguments are interpreted as properties of the instance

callback_changed_add(func, *args, **kwargs)

The clock’s user changed the time

callback_changed_del(func)
edit

Whether a given clock widget is under edition mode or under (default) displaying-only mode.

This property reflects whether the clock editable or not by user interaction. When in edition mode, clocks stop ticking, until one brings them back to canonical mode. The edit_mode property will influence which digits of the clock will be editable.

Note

am/pm sheets, if being shown, will always be editable under edition mode.

Type

bool

edit_get(edit)
edit_mode

Which digits of the given clock widget should be editable when in edition mode.

Type

Clock edit modes

edit_mode_get()
edit_mode_set(mode)
edit_set(edit)
first_interval

The first interval on time updates for a user mouse button hold on clock widgets’ time edition.

This interval value is decreased while the user holds the mouse pointer either incrementing or decrementing a given the clock digit’s value.

This helps the user to get to a given time distant from the current one easier/faster, as it will start to flip quicker and quicker on mouse button holds.

The calculation for the next flip interval value, starting from the one set with this call, is the previous interval divided by 1.05, so it decreases a little bit.

The default starting interval value for automatic flips is 0.85 seconds.

Type

float

first_interval_get()
first_interval_set(interval)
pause

The paused state of the clock widget

Type

bool

New in version 1.9.

pause_get()
pause_set(value)
show_am_pm

Whether the given clock widget must show hours in military or am/pm mode

This property reflects if the clock must show hours in military or am/pm mode. In some countries like Brazil the military mode (00-24h-format) is used, in opposition to the USA, where the am/pm mode is more commonly used.

True, if in am/pm mode, False if in military

Type

bool

show_am_pm_get()
show_am_pm_set(am_pm)
show_seconds

Whether the given clock widget must show time with seconds or not

By default, they are not shown.

Type

bool

show_seconds_get()
show_seconds_set(seconds)
time

The clock widget’s time

This property reflects the time that is showed by the clock widget.

Values must be set within the following ranges:

  • 0 - 23, for hours

  • 0 - 59, for minutes

  • 0 - 59, for seconds,

even if the clock is not in “military” mode.

Warning

The behavior for values set out of those ranges is undefined.

Type

(int h, int m, int s)

time_get()
time_set(hours, minutes, seconds)