NbtkListView

NbtkListView — a box layout driven by a model.

Synopsis

                    NbtkListView;
NbtkWidget*         nbtk_list_view_new                  (void);
void                nbtk_list_view_set_model            (NbtkListView *list_view,
                                                         ClutterModel *model);
ClutterModel*       nbtk_list_view_get_model            (NbtkListView *list_view);
void                nbtk_list_view_set_item_type        (NbtkListView *list_view,
                                                         GType item_type);
GType               nbtk_list_view_get_item_type        (NbtkListView *list_view);
void                nbtk_list_view_add_attribute        (NbtkListView *list_view,
                                                         const gchar *attribute,
                                                         gint column);
void                nbtk_list_view_freeze               (NbtkListView *list_view);
void                nbtk_list_view_thaw                 (NbtkListView *list_view);
void                nbtk_list_view_set_factory          (NbtkListView *list_view,
                                                         NbtkItemFactory *factory);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----ClutterActor
               +----NbtkWidget
                     +----NbtkBoxLayout
                           +----NbtkListView

Implemented Interfaces

NbtkListView implements ClutterScriptable, ClutterAnimatable, AtkImplementorIface, NbtkStylable, ClutterContainer and NbtkScrollable.

Properties

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

Description

NbtkListView is a box 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 NbtkItemFactor.

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

Details

NbtkListView

typedef struct _NbtkListView NbtkListView;

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


nbtk_list_view_new ()

NbtkWidget*         nbtk_list_view_new                  (void);

Create a new NbtkListView

Returns :

a newly allocated NbtkListView

nbtk_list_view_set_model ()

void                nbtk_list_view_set_model            (NbtkListView *list_view,
                                                         ClutterModel *model);

Set the model used by the NbtkListView

list_view :

An NbtkListView

model :

A ClutterModel

nbtk_list_view_get_model ()

ClutterModel*       nbtk_list_view_get_model            (NbtkListView *list_view);

Get the model currently used by the NbtkListView

list_view :

An NbtkListView

Returns :

the current ClutterModel

nbtk_list_view_set_item_type ()

void                nbtk_list_view_set_item_type        (NbtkListView *list_view,
                                                         GType item_type);

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

list_view :

An NbtkListView

item_type :

A GType

nbtk_list_view_get_item_type ()

GType               nbtk_list_view_get_item_type        (NbtkListView *list_view);

Get the item type currently being used to create items

list_view :

An NbtkListView

Returns :

a GType

nbtk_list_view_add_attribute ()

void                nbtk_list_view_add_attribute        (NbtkListView *list_view,
                                                         const gchar *attribute,
                                                         gint column);

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

list_view :

An NbtkListView

attribute :

Name of the attribute

column :

Column number

nbtk_list_view_freeze ()

void                nbtk_list_view_freeze               (NbtkListView *list_view);

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

list_view :

An NbtkListView

nbtk_list_view_thaw ()

void                nbtk_list_view_thaw                 (NbtkListView *list_view);

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

list_view :

An NbtkListView

nbtk_list_view_set_factory ()

void                nbtk_list_view_set_factory          (NbtkListView *list_view,
                                                         NbtkItemFactory *factory);

Sets factory to be the factory used for creating new list items

list_view :

A NbtkListView

factory :

A NbtkItemFactory

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.