NbtkItemView

NbtkItemView — a flow layout driven by a model.

Synopsis

                    NbtkItemView;
NbtkWidget*         nbtk_item_view_new                  (void);
void                nbtk_item_view_set_model            (NbtkItemView *item_view,
                                                         ClutterModel *model);
ClutterModel*       nbtk_item_view_get_model            (NbtkItemView *item_view);
void                nbtk_item_view_set_item_type        (NbtkItemView *item_view,
                                                         GType item_type);
GType               nbtk_item_view_get_item_type        (NbtkItemView *item_view);
void                nbtk_item_view_add_attribute        (NbtkItemView *item_view,
                                                         const gchar *attribute,
                                                         gint column);
void                nbtk_item_view_freeze               (NbtkItemView *item_view);
void                nbtk_item_view_thaw                 (NbtkItemView *item_view);
void                nbtk_item_view_set_factory          (NbtkItemView *item_view,
                                                         NbtkItemFactory *factory);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----ClutterActor
               +----NbtkWidget
                     +----NbtkGrid
                           +----NbtkItemView

Implemented Interfaces

NbtkItemView implements ClutterScriptable, NbtkStylable, ClutterContainer and NbtkScrollable.

Properties

  "item-type"                GType*                : Read / Write
  "model"                    ClutterModel*         : Read / Write

Description

NbtkItemView is a flow layout container driven by a ClutterModel. Children are created for each row in the model, either by creating actors from the supplied ClutterActor derived type, or from a NbtkItemFactory.

Data is set on the children by mapping columns in the model to object properties on the children.

Details

NbtkItemView

typedef struct _NbtkItemView NbtkItemView;

The contents of the this structure are private and should only be accessed through the public API.


nbtk_item_view_new ()

NbtkWidget*         nbtk_item_view_new                  (void);

Create a new NbtkItemView

Returns :

a newly allocated NbtkItemView

nbtk_item_view_set_model ()

void                nbtk_item_view_set_model            (NbtkItemView *item_view,
                                                         ClutterModel *model);

Set the model used by the NbtkItemView

item_view :

An NbtkItemView

model :

A ClutterModel

nbtk_item_view_get_model ()

ClutterModel*       nbtk_item_view_get_model            (NbtkItemView *item_view);

Get the model currently used by the NbtkItemView

item_view :

An NbtkItemView

Returns :

the current ClutterModel

nbtk_item_view_set_item_type ()

void                nbtk_item_view_set_item_type        (NbtkItemView *item_view,
                                                         GType item_type);

Set the item type used to create items representing each row in the model

item_view :

An NbtkItemView

item_type :

A GType

nbtk_item_view_get_item_type ()

GType               nbtk_item_view_get_item_type        (NbtkItemView *item_view);

Get the item type currently being used to create items

item_view :

An NbtkItemView

Returns :

a GType

nbtk_item_view_add_attribute ()

void                nbtk_item_view_add_attribute        (NbtkItemView *item_view,
                                                         const gchar *attribute,
                                                         gint column);

Adds an attribute mapping between the current model and the objects from the cell renderer.

item_view :

An NbtkItemView

attribute :

Name of the attribute

column :

Column number

nbtk_item_view_freeze ()

void                nbtk_item_view_freeze               (NbtkItemView *item_view);

Freeze the view. This means that the view will not act on changes to the model until it is thawed. Call nbtk_item_view_thaw() to thaw the view

item_view :

An NbtkItemView

nbtk_item_view_thaw ()

void                nbtk_item_view_thaw                 (NbtkItemView *item_view);

Thaw the view. This means that the view will now act on changes to the model.

item_view :

An NbtkItemView

nbtk_item_view_set_factory ()

void                nbtk_item_view_set_factory          (NbtkItemView *item_view,
                                                         NbtkItemFactory *factory);

item_view :

factory :

Property Details

The "item-type" property

  "item-type"                GType*                : Read / Write

The GType to use as the items in the view. Must be a subclass of ClutterActor.


The "model" property

  "model"                    ClutterModel*         : Read / Write

The model for the item view.