NbtkComboBox

NbtkComboBox — combo box actor

Synopsis

                    NbtkComboBox;
NbtkComboBox *      nbtk_combo_box_new                  (void);
void                nbtk_combo_box_insert_text          (NbtkComboBox *box,
                                                         gint position,
                                                         const gchar *text);
void                nbtk_combo_box_append_text          (NbtkComboBox *box,
                                                         const gchar *text);
void                nbtk_combo_box_prepend_text         (NbtkComboBox *box,
                                                         const gchar *text);
void                nbtk_combo_box_remove_text          (NbtkComboBox *box,
                                                         gint position);
void                nbtk_combo_box_set_title            (NbtkComboBox *box,
                                                         const gchar *title);
const gchar*        nbtk_combo_box_get_title            (NbtkComboBox *box);
void                nbtk_combo_box_set_index            (NbtkComboBox *box,
                                                         gint index);
const gint          nbtk_combo_box_get_index            (NbtkComboBox *box);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----ClutterActor
               +----NbtkWidget
                     +----NbtkComboBox

Implemented Interfaces

NbtkComboBox implements ClutterScriptable and NbtkStylable.

Properties

  "index"                    gint                  : Read / Write
  "title"                    gchar*                : Read / Write

Description

NbtkComboBox combines a button with a popup menu to allow the user to select an option from a list.

Details

NbtkComboBox

typedef struct _NbtkComboBox NbtkComboBox;

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


nbtk_combo_box_new ()

NbtkComboBox *      nbtk_combo_box_new                  (void);

Create a new NbtkComboBox

Returns :

a newly allocated NbtkComboBox

nbtk_combo_box_insert_text ()

void                nbtk_combo_box_insert_text          (NbtkComboBox *box,
                                                         gint position,
                                                         const gchar *text);

Insert an item into the combo box list.

box :

A NbtkComboBox

position :

zero indexed position to insert the item at

text :

name of the item

nbtk_combo_box_append_text ()

void                nbtk_combo_box_append_text          (NbtkComboBox *box,
                                                         const gchar *text);

Append an item to the combo box list

box :

A NbtkComboBox

text :

name of the item

nbtk_combo_box_prepend_text ()

void                nbtk_combo_box_prepend_text         (NbtkComboBox *box,
                                                         const gchar *text);

Prepend an item to the combo box list

box :

A NbtkComboBox

text :

name of the item

nbtk_combo_box_remove_text ()

void                nbtk_combo_box_remove_text          (NbtkComboBox *box,
                                                         gint position);

Remove the item at position

box :

A NbtkComboBox

position :

position of the item to remove

nbtk_combo_box_set_title ()

void                nbtk_combo_box_set_title            (NbtkComboBox *box,
                                                         const gchar *title);

Set the text displayed in the combo box

box :

A NbtkComboBox

title :

text to display

nbtk_combo_box_get_title ()

const gchar*        nbtk_combo_box_get_title            (NbtkComboBox *box);

Get the text displayed in the combo box

box :

A NbtkComboBox

Returns :

the text string, owned by the combo box

nbtk_combo_box_set_index ()

void                nbtk_combo_box_set_index            (NbtkComboBox *box,
                                                         gint index);

Set the currenet combo box text from the item at index in the list.

box :

A NbtkComboBox

index :

the index of the list item to set

nbtk_combo_box_get_index ()

const gint          nbtk_combo_box_get_index            (NbtkComboBox *box);

Get the index of the last item selected

box :

A NbtkComboBox

Returns :

const gint

Property Details

The "index" property

  "index"                    gint                  : Read / Write

Index of the selected item, or -1 if no item is selected.

Allowed values: >= G_MAXULONG

Default value: -1


The "title" property

  "title"                    gchar*                : Read / Write

Text currently displayed in the combo box button.

Default value: ""