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.

Ancestry

Up to the first non-hildon ancestor:

...
 +-- gtk.Container
      +-- hildon.Grid

Usage Example

See hildon.GridItem

Properties

Name Access Description
"empty_label" Read/Write Label to show when grid has no items.
"style" Read/Write Widget's Style. Setting style sets widget size, spacing, label position, number of columns, and icon sizeLabel to show when grid has no items.
"scrollbar-position" Read/Write View (scrollbar) position.

Style Properties

Name Access Description
"item_height" Read Total height of an item.
"item_hspacing" Read Item horizontal spacing. Margin between two columns and labels.
"item_vspacing" Read Item vertical spacing. Icon on right: Margin between rows / Icon at bottom: Vertical margin between label and icon.
"label_hspacing" Read Margin between focus edge and item edge.
"label_vspacing" Read Vertical margin between item and label.
"label_height" Read Height of icon label.
"n_columns" Read Number of columns.
"label_pos" Read Position of label related to the icon.
"icon_size" Read Size of the icon in pixels (width).
"emblem_size" Read Size of the emblem in pixels.

Constructor

Creates a new hildon.Grid widget.

hildon.Grid()
Returns A new hildon.Grid.

Methods

set_style

Sets style. Setting style sets widget size, spacing, label position, number of columns, and icon size.

hildon.Grid.set_style(style_name)
style_name Style name.

get_style

Returns the name of the style being currently used.

hildon.Grid.get_style()
Returns Style name.

set_scrollbar_pos

Sets view (scrollbar) to specified position.

hildon.Grid.set_scrollbar_pos(scrollbar_pos)
scrollbar_pos New position (in pixels).

get_scrollbar_pos

Returns position of scrollbar (in pixels).

hildon.Grid.get_scrollbar_pos()
Returns Scrollbar position.

activate_child

Emits a signal to tell HildonGridItem was actiavated.

hildon.Grid.activate_child(item)
item Grid item to be activated.

Signals

activate-child

Emitted when a child (hildon.GridItem) is activated either by tapping on it or by pressing enter.

def callback(grid, grid_item, user_param1, ...)
grid hildon.Grid that received the signal.
grid_item hildon.GridItem that was activated.
user_param1 The first user parameter (if any) specified with the connect() method.
... Additional user parameters (if any).

popup-context-menu

Emitted when popup-menu is supposed to open. Used for tap-and-hold.

def callback(grid, grid_item, user_param1, ...)
grid hildon.Grid that received the signal.
grid_item A hildon.GridItem.
user_param1 The first user parameter (if any) specified with the connect() method.
... Additional user parameters (if any).


Improve this page