Hildon Widgets API for Python

hildon.CalendarPopup

A dialog which contains a gtk.Calendar.

Description

hildon.CalendarPopup is a dialog which contains a gtk.Calendar. It also contains arrow
buttons for changing month/year. The earliest possible date is 1/1/1980 and the latest date 31/12/2100. If
navigating with keyboard to a date that is not in the current month the calendar moves to the corresponding
month. If the new date would be unallowed then an information banner will be shown. The usage of
CalendarPopup is shown in the following code. This function should be connect to eg. button-press-event.

Constructor

This function returns a new hildon.CalendarPopup. The initially selected date is specified by the parameters
(year, month, day). If the specified date is invalid, the current date is used.

hildon.CalendarPopup(parent, year, month, day)

parent

parent window for dialog

year

initial year

month

initial month

day

initial day

Returns

A new hildon.CalendarPopup widget.

Methods

set_date

This method activates a new date on the calendar popup.

hildon.CalendarPopup.set_date(year, month, day)

year

A year

month

A month

day

A day

get_date

This method is used to get the currently selected year, month, and day.

hildon.CalendarPopup.get_date()

Returns

A tuple of the form (year, month, day).

hildon.ColorButton

A widget to open a hildon.ColorSelector.

Description

hildon.ColorButton is a widget to open hildon.ColorSelector. The color field in the
button shows the selected color. The current color is set as a property to the button. The property name is
"color" and it's type is gtk.gdk.Color.

Properties

Name

Access

Description

"color"

Read/Write

The selected color.

Constructor

Creates a new color button. This returns a widget in the form of a small button containing a swatch
representing the current selected color. When the button is clicked, a color-selection dialog will open,
allowing the user to select a color. The swatch will be updated to reflect the new color when the user finishes.

hildon.ColorButton(color)

color (optional)

A gtk.gdk.Color to set the current color with.

Returns

A new color button.

Methods

get_color

Gets a color from the button.

hildon.ColorButton.get_color()

Returns

The color set to the button.

set_color

Sets a color to the button.

hildon.ColorButton.set_color(color)

color

A color to be set.

hildon.ColorSelector

A widget for selecting a color.

Description

hildon.ColorSelector allows a selection of a color. It consists of a control that
displays the default palette of 16 colors and a control that can be opened to select a custom color
from a 16M color palette.

Properties

Constructor

Creates a new hildon.ColorSelector dialog with 3x8 layout of base colors and
'OK', 'Modify' and 'Cancel' buttons.

hildon.ColorSelector(parent)

parent

The parent window.

Returns

A new hildon.ColorSelector.

Methods

get_color

Gets the currently selected color as gtk.gdk.Color.

hildon.ColorSelector.get_color()

Returns

A copy of the currently selected gtk.gdk.Color.

set_color

Select the color specified. Does nothing if the color does not exists among the standard colors.

hildon.ColorSelector.set_color(color)

color

gtk.gdk.Color to set.

hildon.Controlbar

A widget that allows increasing or decreasing a value within a pre-defined range.

Description

hildon.Controlbar is a horizontally positioned widget that allows increasing or
decreasing a value within a pre-defined range. The amount of steps in a hildon.Controlbar
can be changed.

Ancestry

Up to the first non-hildon ancestor:

...

+-- gtk.Scale

+-- hildon.Controlbar

Usage Example

import gtk

import hildon
def control_changed(widget, label):

label.set_text("Min:%s | Current: %s | Max:%s" %

(widget.get_min(), widget.get_value(), widget.get_max()))

window = hildon.Window()

window.set_title("Test App")

label = gtk.Label()

controlbar = hildon.Controlbar(0, 50, 15)

controlbar.connect("value-changed", control_changed, label)

control_changed(controlbar, label)

#Init label text
vbox = gtk.VBox(False, 10)

vbox.pack_start (controlbar)

vbox.pack_start (label)

window.add(vbox)

window.show_all()

gtk.main()

Properties

Name

Access

Description

"min"

Read/Write

Smallest possible value.

"max"

Read/Write

Greatest possible value.

"value"

Read/Write

Current value.

Style Properties

Name

Access

Description

"inner_border_width"

Read

The border spacing between the controlbar border and controlbar blocks.

Constructor

Creates a new hildon.Controlbar widget.

hildon.Controlbar(min, max, value)

min (optional)

Minimum value.

max (optional)

Maximum value.

value (optional)

Initial value.

Returns

A new hildon.Controlbar widget.

Methods

get_value

Accessor method for getting its current value.

hildon.Controlbar.get_value()

Returns

Its current value.

set_value

Accessor method for changing its current value.

hildon.Controlbar.set_value(value)

value

Its current value.

get_min

Accessor method for getting its minimum value.

hildon.Controlbar.get_min()

Returns

Its minimum value.

set_min

Accessor method for changing its minimum value.

hildon.Controlbar.set_min(min)

min

Its minimum value.

get_max

Accessor method for getting its maximum value.

hildon.Controlbar.get_max()

Returns

Its maximum value.

set_max

Accessor method for changing its maximum value.

hildon.Controlbar.set_max(max)

max

Its maximum value.

set_range

Set its range, that is, both its maximum and minimum values.

hildon.Controlbar.set_range(min, max)

min

Its minimum value.

max

Its maximum value.

hildon.DateEditor

A simple widget with three entry fields (day, month, year) and an icon (eventbox). The clicking of
that icon opens up a hildon.CalendarPopup.

Description

It's a simple widget with three entry fields (day, month, year) and an icon (eventbox). The clicking of
that icon opens up a hildon.CalendarPopup. The current system date is shown in the editor by default.

Ancestry

Up to the first non-hildon ancestor:

...

+-- gtk.Container

+-- hildon.DateEditor

Usage Example

import gtk

import hildon

window = hildon.Window()

window.set_title("Test App")

dateeditor = hildon.DateEditor(2006, 4, 20)

window.add(dateeditor)

window.show_all()

gtk.main()

Properties

Name

Access

Description

"year"

Read/Write

Current year.

"month"

Read/Write

Current month.

"day"

Read/Write

Current day.

"min-year"

Read/Write

Minimum valid year.

"max-year"

Read/Write

Maximum valid year.

Constructor

Creates a new hildon.DateEditor widget.

hildon.DateEditor(year, month, day, min-year, max-year)

year (optional)

A year.

month (optional)

A month.

day (optional)

A day.

min-year (optional)

The minimum allowable year.

min-year (optional)

The maximum allowable year.

Returns

A new hildon.DateEditor widget.

Methods

get_date

This method is used to get the currently selected year, month, and day.

hildon.DateEditor.get_date()

Returns

A tuple of the form (year, month, day).

set_date

This method activates a new date on the calendar popup.

hildon.DateEditor.set_date(year, month, day)

year

A year

month

A month

day

A day

get_year

This method is used to get the currently selected year.

hildon.DateEditor.get_year()

Returns

The currently selected year.

set_year

This method is used to select the year.

hildon.DateEditor.set_year(year)

year

The year to be selected.

get_month

This method is used to get the currently selected month.

hildon.DateEditor.get_month()

Returns

The currently selected month.

set_month

This method is used to select the month.

hildon.DateEditor.set_month(month)

month

The month to be selected.

get_day

This method is used to get the currently selected day.

hildon.DateEditor.get_day()

Returns

The currently selected day.

set_day

This method is used to select the day.

hildon.DateEditor.set_day(day)

day

The day to be selected.

hildon.FileDetailsDialog

hildon-file-system-model documentation and usage it not clear to me.
Have to fix its binding and this document when it's solved.

Used to show details of a file.

Description

Used to show details of a file.

Ancestry

Up to the first non-hildon ancestor:

...

+-- gtk.Dialog

+-- hildon.FileDetailsDialog

Usage Example

Source code.

Properties

"prop-name"

Property description.

Constructor

Bla

hildon.Class(param1)

param1

param1 description

Returns

A new something.

Methods

method_name

Bla

hildon.Class.method_name(param1)

param1

Param1 desc

hildon.FontSelectionDialog

A widget is used to select a font with certain properties

Description

Font selection dialog provides the user with the possiblity to choose a different font family, font size,
font color, font weight (bold or not bold), font style (italic or not italic), underline, strikethrough,
and position (normal, superscript or subscript).

set_emblem_type

hildon.Grid

Intended to be used where ever a number of single tap activatable items need to be presented (e.g. Control Panel applets).

Description

hildon.Grid is a set of application-defineable items that are presented in a table. The form of
this table is selected from two modes: large icon mode and small icon mode. In large icon mode, the Grid View
items are presented with a large icon and a label underneath it. In small icon mode, the items are presented
with a small icon and a label on the right side of the icon. The label of an item is displayed within a band
of colour displayed as a background colour as wide as the maximum text width. This allows the text to have
focus as well as be legible when displayed upon a black or dark background image. Long names are truncated
with an ellipsis ("...") appended.

set_domain

hildon.Note

A widget to ask confirmation from the user or to show some information to him.

Description

Notes are used to ask a confirmation (Ok/Cancel/etc.) from the user. A simple note contains an
information text and an Ok-button to be pressed. Additional features can be e.g. progressbars
or animations.

Constructor

Creates a new hildon.Note widget. Its type is specified in the note_type argument.

Each type of hildon.Note needs a different set of arguments, both in quantity and in quality.
To handle this, note_type states the desired type and note_tuple contains a
tuple having the arguments needed by the specified note type. The following table relates a note type with its
correspondent note_type value and note_tuple format:

Note Type

note_type value

note_tuple format

Confirmation

"confirmation"

(parent, description, icon_name(optional))

Information

"information"

(parent, description, icon_name(optional))

A progress bar with a "Cancel" button

"cancel_with_progress_bar"

(parent, description, progress_bar)

Tuple Arguments

parent

Its parent window.

description

The note's message/description.

icon_name (optional)

Name of the icon to be used in the dialog (e.g.: gtk.STOCK_DIALOG_WARNING). If not specified, the default icon will be used.

progress_bar

The gtk.ProgressBar to be used by this note.

hildon.Note(note_type, note_tuple)

note_type

The type of the Note widget.

note_tuple

A tuple containing the construction parameters according to the note type specified in note_type

Returns

A new hildon.Note widget.

Methods

set_button_text

Sets the button text to be used by this hildon.Note widget.

hildon.Note.set_button_text(text)

text

Sets the button text and if there are two buttons in the dialog the button's texts will be <text> and "Cancel".

set_button_texts

Sets the button texts to be used by this hildon.Note widget.

hildon.Note.set_button_texts(textOk, textCancel)

textOk

The new text for the "Ok" button.

textCancel

The new text for the "Cancel" button.

hildon.NumberEditor

A widget used to set a number.

Description

hildon.NumberEditor is used to set a number from a specific range. There are two buttons
to scroll the value in the number field and manual input is also possible.

get_duration_max

set_duration_max

Sets the maximum allowed duration for the duration mode. Note: Has no effect in time mode.

hildon.TimeEditor.get_duration_max(duration_max)

duration_max

Maximum allowed duration, in seconds.

hildon.TimePicker

A dialog popup widget which lets the user set a time.

Description

hildon.TimePicker is a dialog popup widget which lets the user set a time. using up/down
arrows on hours and minutes. There are two arrows for minutes, so that minutes can be added also in
10min steps.

Properties

Name

Access

Description

"minutes"

Read/Write

The selected time in minutes since midnight.

"arrow-width"

Read

Increase/decrease arrows width.

"arrow-height"

Read

Increase/decrease arrows height.

Constructor

Hildon Time Picker shows a time picker dialog. Close button is placed in dialog's action area and
time picker is placed in dialogs vbox. Actual time picker consists two gtk.Label
fields, one for hours and other for minutes, arrow buttons and an AM/PM button. A ":" is placed between hours and minutes fields.

hildon.TimePicker(parent)

parent

Its parent window.

Returns

A new hildon.TimePicker.

Methods

get_time

Gets the time currently set in the dialog.

hildon.Class.get_time()

Returns

A tuple of the form (hours, minutes), with hours being in 24h format.

set_time

Sets the time to be shown in the dialog.

hildon.Class.set_time(hours, minutes)

hours

Hours in 24h format.

minutes

Minutes.

hildon.Volumebar

Base class for widgets that displays a volume bar.

Description

hildon.Volumebar is a base class for widgets that displays a volume bar that allows
increasing or decreasing volume within a pre-defined range and muting the volume by clicking on a specific mute icon.

Ancestry

Up to the first non-hildon ancestor:

...
+-- gtk.Container
+-- hildon.Volumebar

Properties

Name

Access

Description

"can-focus"

Read/Write/Construct

The widget focusablility. True is focusable.

"has_mute"

Read/Write/Construct

Whether the mute button is visible. Default value is True.

"level"

Read/Write

Current volume level. Varies from 0.0 to 100.0.

"mute"

Read/Write

Whether volume is muted.

Signals

"mute_toggled"

def callback(widget, user_param1, ...)

"level_changed"

def callback(widget, user_param1, ...)

Methods

get_level

Gets the volume level, ranging between 0.0 and 100.0 (inclusive).

hildon.Volumebar.get_level()

Returns

The volume level

set_level

Sets the volume level, ranging between 0.0 and 100.0 (inclusive).

hildon.Volumebar.set_level(level)

level

The new volume level

get_mute

Gets mute status.

hildon.Volumebar.get_mute()

Returns

True if it's mute and False otherwise.

set_mute

Sets mute status.

hildon.Volumebar.set_mute(mute)

mute

True to mute and False otherwise.

level_change

Emits "level_changed" signal to the given volumebar. This method is mainly used by derived classes.

hildon.Volumebar.level_change()

get_adjustment

Gets the gtk.Adjustment used in volumebar.

This is a temporary solution until volumebar is restructured to be a child class of gtk.Range.

hildon.Volumebar.get_adjustment()

Returns

A gtk.Adjustment used by the volume bar.

hildon.VVolumebar

A widget that displays a vertical volume bar.

Description

The hildon.VVolumebar widget displays a vertical volume bar that allows increasing or
decreasing volume within a pre-defined range, and muting the volume by clicking on a specific mute icon.

Constructor

hildon.WeekdayPicker

A widget for selecting weekday(s).

Description

Weekday picker supports non-mutually exclusive selection of days of the week. Selected days of
the week are shown with a pushed-in effect.

Weekday picker is used where users are required to pick days on which a certain event should
take place, for example, which days a Calendar event should be repeated on. It is used in
Calendar in the Repeat dialog, in Tasks in the Repeat dialog and in the Email set-up wizard.