Gtk.Combo_Box

Entities

Tagged Types

Access Types

Constants

Subprograms

Generic Instantiations

Description

A GtkComboBox is a widget that allows the user to choose from a list of valid choices. The GtkComboBox displays the selected choice. When activated, the GtkComboBox displays a popup which allows the user to make a new choice. The style in which the selected value is displayed, and the style of the popup is determined by the current theme. It may be similar to a Windows-style combo box.

The GtkComboBox uses the model-view pattern; the list of valid choices is specified in the form of a tree model, and the display of the choices can be adapted to the data in the model by using cell renderers, as you would in a tree view. This is possible since GtkComboBox implements the Gtk.Cell_Layout.Gtk_Cell_Layout interface. The tree model holding the valid choices is not restricted to a flat list, it can be a real tree, and the popup will reflect the tree structure.

To allow the user to enter values not in the model, the "has-entry" property allows the GtkComboBox to contain a Gtk.GEntry.Gtk_Entry. This entry can be accessed by calling Gtk.Bin.Get_Child on the combo box.

For a simple list of textual choices, the model-view API of GtkComboBox can be a bit overwhelming. In this case, Gtk.Combo_Box_Text.Gtk_Combo_Box_Text offers a simple alternative. Both GtkComboBox and Gtk.Combo_Box_Text.Gtk_Combo_Box_Text can contain an entry.

# CSS nodes

combobox
├── box.linked
│   ╰── button.combo
│       ╰── box
│           ├── cellview
│           ╰── arrow
╰── window.popup

A normal combobox contains a box with the .linked class, a button with the .combo class and inside those buttons, there are a cellview and an arrow.

combobox
├── box.linked
│   ├── entry.combo
│   ╰── button.combo
│       ╰── box
│           ╰── arrow
╰── window.popup

A GtkComboBox with an entry has a single CSS node with name combobox. It contains a box with the .linked class. That box contains an entry and a button, both with the .combo class added. The button also contains another node with name arrow.

<group>Numeric/Text Data Entry</group>

"+"

function "+"
  (Widget : access Gtk_Combo_Box_Record'Class)
return Gtk.Buildable.Gtk_Buildable
Parameters
Widget
Return Value

"+"

function "+"
  (Widget : access Gtk_Combo_Box_Record'Class)
return Gtk.Cell_Editable.Gtk_Cell_Editable
Parameters
Widget
Return Value

"+"

function "+"
  (Widget : access Gtk_Combo_Box_Record'Class)
return Gtk.Cell_Layout.Gtk_Cell_Layout
Parameters
Widget
Return Value

"-"

function "-"
  (Interf : Gtk.Buildable.Gtk_Buildable)
return Gtk_Combo_Box
Parameters
Interf
Return Value

"-"

function "-"
  (Interf : Gtk.Cell_Editable.Gtk_Cell_Editable)
return Gtk_Combo_Box
Parameters
Interf
Return Value

"-"

function "-"
  (Interf : Gtk.Cell_Layout.Gtk_Cell_Layout)
return Gtk_Combo_Box
Parameters
Interf
Return Value

Active_Id_Property

Active_Id_Property : constant Glib.Properties.Property_String;

The value of the ID column of the active row.

Active_Property

Active_Property : constant Glib.Properties.Property_Int;

The item which is currently active. If the model is a non-flat treemodel, and the active item is not an immediate child of the root of the tree, this property has the value gtk_tree_path_get_indices (path)[0], where path is the Gtk.Tree_Model.Gtk_Tree_Path of the active item.

Add_Attribute

procedure Add_Attribute
   (Cell_Layout : not null access Gtk_Combo_Box_Record;
    Cell        : not null access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class;
    Attribute   : UTF8_String;
    Column      : Glib.Gint)
Parameters
Cell_Layout
Cell
Attribute
Column

Add_Tearoffs_Property

Add_Tearoffs_Property : constant Glib.Properties.Property_Boolean;

The add-tearoffs property controls whether generated menus have tearoff menu items.

Note that this only affects menu style combo boxes.

Button_Sensitivity_Property

Button_Sensitivity_Property : constant Gtk.Enums.Property_Gtk_Sensitivity_Type;

Whether the dropdown button is sensitive when the model is empty.

Cb_GObject_Boolean

type Cb_GObject_Boolean is not null access function
  (Self : access Glib.Object.GObject_Record'Class)
return Boolean;
Parameters
Self
Return Value

Cb_GObject_Gtk_Scroll_Type_Void

type Cb_GObject_Gtk_Scroll_Type_Void is not null access procedure
  (Self        : access Glib.Object.GObject_Record'Class;
   Scroll_Type : Gtk.Enums.Gtk_Scroll_Type);
Parameters
Self
Scroll_Type

Cb_GObject_UTF8_String_UTF8_String

type Cb_GObject_UTF8_String_UTF8_String is not null access function
  (Self : access Glib.Object.GObject_Record'Class;
   Path : UTF8_String) return UTF8_String;
Parameters
Self
Path
Return Value

Cb_GObject_Void

type Cb_GObject_Void is not null access procedure
  (Self : access Glib.Object.GObject_Record'Class);
Parameters
Self

Cb_Gtk_Combo_Box_Boolean

type Cb_Gtk_Combo_Box_Boolean is not null access function
  (Self : access Gtk_Combo_Box_Record'Class) return Boolean;
Parameters
Self
Return Value

Cb_Gtk_Combo_Box_Gtk_Scroll_Type_Void

type Cb_Gtk_Combo_Box_Gtk_Scroll_Type_Void is not null access procedure
  (Self        : access Gtk_Combo_Box_Record'Class;
   Scroll_Type : Gtk.Enums.Gtk_Scroll_Type);
Parameters
Self
Scroll_Type

Cb_Gtk_Combo_Box_UTF8_String_UTF8_String

type Cb_Gtk_Combo_Box_UTF8_String_UTF8_String is not null access function
  (Self : access Gtk_Combo_Box_Record'Class;
   Path : UTF8_String) return UTF8_String;
Parameters
Self
Path
Return Value

Cb_Gtk_Combo_Box_Void

type Cb_Gtk_Combo_Box_Void is not null access procedure (Self : access Gtk_Combo_Box_Record'Class);
Parameters
Self

Cell_Area_Property

Cell_Area_Property : constant Glib.Properties.Property_Object;

Type: Gtk.Cell_Area.Gtk_Cell_Area The Gtk.Cell_Area.Gtk_Cell_Area used to layout cell renderers for this combo box.

If no area is specified when creating the combo box with Gtk.Combo_Box.Gtk_New_With_Area a horizontally oriented Gtk.Cell_Area_Box.Gtk_Cell_Area_Box will be used.

Clear

procedure Clear (Cell_Layout : not null access Gtk_Combo_Box_Record)
Parameters
Cell_Layout

Clear_Attributes

procedure Clear_Attributes
   (Cell_Layout : not null access Gtk_Combo_Box_Record;
    Cell        : not null access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class)
Parameters
Cell_Layout
Cell

Column_Span_Column_Property

Column_Span_Column_Property : constant Glib.Properties.Property_Int;

If this is set to a non-negative value, it must be the index of a column of type G_TYPE_INT in the model. The value in that column for each item will determine how many columns that item will span in the popup. Therefore, values in this column must be greater than zero, and the sum of an item's column position + span should not exceed Gtk.Combo_Box.Gtk_Combo_Box:wrap-width.

Editing_Done

procedure Editing_Done
   (Cell_Editable : not null access Gtk_Combo_Box_Record)
Parameters
Cell_Editable

Entry_Text_Column_Property

Entry_Text_Column_Property : constant Glib.Properties.Property_Int;

The column in the combo box's model to associate with strings from the entry if the combo was created with Gtk.Combo_Box.Gtk_Combo_Box:has-entry = True.

Get_Active

function Get_Active
   (Combo_Box : not null access Gtk_Combo_Box_Record) return Glib.Gint

Returns the index of the currently active item, or -1 if there's no active item. If the model is a non-flat treemodel, and the active item is not an immediate child of the root of the tree, this function returns gtk_tree_path_get_indices (path)[0], where path is the Gtk.Tree_Model.Gtk_Tree_Path of the active item. Since: gtk+ 2.4

Parameters
Combo_Box
Return Value

An integer which is the index of the currently active item, or -1 if there's no active item.

Get_Active_Id

function Get_Active_Id
   (Combo_Box : not null access Gtk_Combo_Box_Record) return UTF8_String

Returns the ID of the active row of Combo_Box. This value is taken from the active row and the column specified by the Gtk.Combo_Box.Gtk_Combo_Box:id-column property of Combo_Box (see Gtk.Combo_Box.Set_Id_Column). The returned value is an interned string which means that you can compare the pointer by value to other interned strings and that you must not free it. If the Gtk.Combo_Box.Gtk_Combo_Box:id-column property of Combo_Box is not set, or if no row is active, or if the active row has a null ID value, then null is returned. Since: gtk+ 3.0

Parameters
Combo_Box
Return Value

the ID of the active row, or null

Get_Active_Iter

function Get_Active_Iter
  (Combo_Box : not null access Gtk_Combo_Box_Record)
return Gtk.Tree_Model.Gtk_Tree_Iter

Return the currently active iter

Parameters
Combo_Box
Return Value

Get_Active_Text

function Get_Active_Text
  (Combo_Box : not null access Gtk_Combo_Box_Record)
return UTF8_String

Return the text present in the entry if it has one, or the empty string

Parameters
Combo_Box
Return Value

Get_Add_Tearoffs

function Get_Add_Tearoffs
   (Combo_Box : not null access Gtk_Combo_Box_Record) return Boolean

Gets the current value of the :add-tearoffs property. Deprecated since 3.10, 1

Parameters
Combo_Box
Return Value

the current value of the :add-tearoffs property.

Get_Button_Sensitivity

function Get_Button_Sensitivity
   (Combo_Box : not null access Gtk_Combo_Box_Record)
    return Gtk.Enums.Gtk_Sensitivity_Type

Returns whether the combo box sets the dropdown button sensitive or not when there are no items in the model. Since: gtk+ 2.14

Parameters
Combo_Box
Return Value

Gtk.Enums.Sensitivity_On if the dropdown button is sensitive when the model is empty, Gtk.Enums.Sensitivity_Off if the button is always insensitive or Gtk.Enums.Sensitivity_Auto if it is only sensitive as long as the model has one item to be selected.

Get_Cells

function Get_Cells
   (Cell_Layout : not null access Gtk_Combo_Box_Record)
    return Gtk.Cell_Renderer.Cell_Renderer_List.Glist
Parameters
Cell_Layout
Return Value

Get_Column_Span_Column

function Get_Column_Span_Column
   (Combo_Box : not null access Gtk_Combo_Box_Record) return Glib.Gint

Returns the column with column span information for Combo_Box. Since: gtk+ 2.6

Parameters
Combo_Box
Return Value

the column span column.

Get_Entry_Text_Column

function Get_Entry_Text_Column
   (Combo_Box : not null access Gtk_Combo_Box_Record) return Glib.Gint

Returns the column which Combo_Box is using to get the strings from to display in the internal entry. Since: gtk+ 2.24

Parameters
Combo_Box
Return Value

A column in the data source model of Combo_Box.

Get_Focus_On_Click

function Get_Focus_On_Click
   (Combo_Box : not null access Gtk_Combo_Box_Record) return Boolean

Returns whether the combo box grabs focus when it is clicked with the mouse. See Gtk.Combo_Box.Set_Focus_On_Click. Since: gtk+ 2.6 Deprecated since 3.20, 1

Parameters
Combo_Box
Return Value

True if the combo box grabs focus when it is clicked with the mouse.

Get_Has_Entry

function Get_Has_Entry
   (Combo_Box : not null access Gtk_Combo_Box_Record) return Boolean

Returns whether the combo box has an entry. Since: gtk+ 2.24

Parameters
Combo_Box
Return Value

whether there is an entry in Combo_Box.

Get_Id_Column

function Get_Id_Column
   (Combo_Box : not null access Gtk_Combo_Box_Record) return Glib.Gint

Returns the column which Combo_Box is using to get string IDs for values from. Since: gtk+ 3.0

Parameters
Combo_Box
Return Value

A column in the data source model of Combo_Box.

Get_Model

function Get_Model
   (Combo_Box : not null access Gtk_Combo_Box_Record)
    return Gtk.Tree_Model.Gtk_Tree_Model

Returns the Gtk.Tree_Model.Gtk_Tree_Model which is acting as data source for Combo_Box. Since: gtk+ 2.4

Parameters
Combo_Box
Return Value

A Gtk.Tree_Model.Gtk_Tree_Model which was passed during construction.

Get_Popup_Fixed_Width

function Get_Popup_Fixed_Width
   (Combo_Box : not null access Gtk_Combo_Box_Record) return Boolean

Gets whether the popup uses a fixed width matching the allocated width of the combo box. Since: gtk+ 3.0

Parameters
Combo_Box
Return Value

True if the popup uses a fixed width

Get_Row_Separator_Func

procedure Get_Row_Separator_Func
   (Combo_Box : not null access Gtk_Combo_Box_Record)

Returns the current row separator function. Since: gtk+ 2.6 @return the current row separator function.

Parameters
Combo_Box

Get_Row_Span_Column

function Get_Row_Span_Column
   (Combo_Box : not null access Gtk_Combo_Box_Record) return Glib.Gint

Returns the column with row span information for Combo_Box. Since: gtk+ 2.6

Parameters
Combo_Box
Return Value

the row span column.

Get_Title

function Get_Title
   (Combo_Box : not null access Gtk_Combo_Box_Record) return UTF8_String

Gets the current title of the menu in tearoff mode. See Gtk.Combo_Box.Set_Add_Tearoffs. Since: gtk+ 2.10 Deprecated since 3.10, 1

Parameters
Combo_Box
Return Value

the menu's title in tearoff mode. This is an internal copy of the string which must not be freed.

Get_Type

function Get_Type return Glib.GType
Return Value

Get_Wrap_Width

function Get_Wrap_Width
   (Combo_Box : not null access Gtk_Combo_Box_Record) return Glib.Gint

Returns the wrap width which is used to determine the number of columns for the popup menu. If the wrap width is larger than 1, the combo box is in table mode. Since: gtk+ 2.6

Parameters
Combo_Box
Return Value

the wrap width.

Gtk_Cell_Layout_Data_Func

type Gtk_Cell_Layout_Data_Func is access procedure
  (Cell_Layout : Gtk.Cell_Layout.Gtk_Cell_Layout;
   Cell        : not null access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class;
   Tree_Model  : Gtk.Tree_Model.Gtk_Tree_Model;
   Iter        : Gtk.Tree_Model.Gtk_Tree_Iter);

A function which should set the value of Cell_Layout's cell renderer(s) as appropriate.

Parameters
Cell_Layout

a Gtk.Cell_Layout.Gtk_Cell_Layout

Cell

the cell renderer whose value is to be set

Tree_Model

the model

Iter

a Gtk.Tree_Model.Gtk_Tree_Iter indicating the row to set the value for

Gtk_Combo_Box

type Gtk_Combo_Box is access all Gtk_Combo_Box_Record'Class;

Gtk_Combo_Box_New

function Gtk_Combo_Box_New return Gtk_Combo_Box

Creates a new empty Gtk.Combo_Box.Gtk_Combo_Box. Since: gtk+ 2.4

Return Value

Gtk_Combo_Box_New_With_Area

function Gtk_Combo_Box_New_With_Area
   (Area : not null access Gtk.Cell_Area.Gtk_Cell_Area_Record'Class)
    return Gtk_Combo_Box

Creates a new empty Gtk.Combo_Box.Gtk_Combo_Box using Area to layout cells.

Parameters
Area

the Gtk.Cell_Area.Gtk_Cell_Area to use to layout cell renderers

Return Value

Gtk_Combo_Box_New_With_Area_And_Entry

function Gtk_Combo_Box_New_With_Area_And_Entry
   (Area : not null access Gtk.Cell_Area.Gtk_Cell_Area_Record'Class)
    return Gtk_Combo_Box

Creates a new empty Gtk.Combo_Box.Gtk_Combo_Box with an entry. The new combo box will use Area to layout cells.

Parameters
Area

the Gtk.Cell_Area.Gtk_Cell_Area to use to layout cell renderers

Return Value

Gtk_Combo_Box_New_With_Entry

function Gtk_Combo_Box_New_With_Entry return Gtk_Combo_Box

Creates a new empty Gtk.Combo_Box.Gtk_Combo_Box with an entry. Since: gtk+ 2.24

Return Value

Gtk_Combo_Box_New_With_Model

function Gtk_Combo_Box_New_With_Model
   (Model : Gtk.Tree_Model.Gtk_Tree_Model) return Gtk_Combo_Box

Creates a new Gtk.Combo_Box.Gtk_Combo_Box with the model initialized to Model. Since: gtk+ 2.4

Parameters
Model

A Gtk.Tree_Model.Gtk_Tree_Model.

Return Value

Gtk_Combo_Box_New_With_Model_And_Entry

function Gtk_Combo_Box_New_With_Model_And_Entry
   (Model : Gtk.Tree_Model.Gtk_Tree_Model) return Gtk_Combo_Box

Creates a new empty Gtk.Combo_Box.Gtk_Combo_Box with an entry and with the model initialized to Model. Since: gtk+ 2.24

Parameters
Model

A Gtk.Tree_Model.Gtk_Tree_Model

Return Value

Gtk_Combo_Box_Record

type Gtk_Combo_Box_Record is new Gtk_Bin_Record with null record;

Gtk_New

procedure Gtk_New (Combo_Box : out Gtk_Combo_Box)

Creates a new empty Gtk.Combo_Box.Gtk_Combo_Box. Since: gtk+ 2.4 Initialize does nothing if the object was already created with another call to Initialize* or G_New.

Parameters
Combo_Box

Gtk_New_With_Area

procedure Gtk_New_With_Area
   (Combo_Box : out Gtk_Combo_Box;
    Area      : not null access Gtk.Cell_Area.Gtk_Cell_Area_Record'Class)

Creates a new empty Gtk.Combo_Box.Gtk_Combo_Box using Area to layout cells. Initialize_With_Area does nothing if the object was already created with another call to Initialize* or G_New.

Parameters
Combo_Box
Area

the Gtk.Cell_Area.Gtk_Cell_Area to use to layout cell renderers

Gtk_New_With_Area_And_Entry

procedure Gtk_New_With_Area_And_Entry
   (Combo_Box : out Gtk_Combo_Box;
    Area      : not null access Gtk.Cell_Area.Gtk_Cell_Area_Record'Class)

Creates a new empty Gtk.Combo_Box.Gtk_Combo_Box with an entry. The new combo box will use Area to layout cells. Initialize_With_Area_And_Entry does nothing if the object was already created with another call to Initialize* or G_New.

Parameters
Combo_Box
Area

the Gtk.Cell_Area.Gtk_Cell_Area to use to layout cell renderers

Gtk_New_With_Entry

procedure Gtk_New_With_Entry (Combo_Box : out Gtk_Combo_Box)

Creates a new empty Gtk.Combo_Box.Gtk_Combo_Box with an entry. Since: gtk+ 2.24 Initialize_With_Entry does nothing if the object was already created with another call to Initialize* or G_New.

Parameters
Combo_Box

Gtk_New_With_Model

procedure Gtk_New_With_Model
   (Combo_Box : out Gtk_Combo_Box;
    Model     : Gtk.Tree_Model.Gtk_Tree_Model)

Creates a new Gtk.Combo_Box.Gtk_Combo_Box with the model initialized to Model. Since: gtk+ 2.4 Initialize_With_Model does nothing if the object was already created with another call to Initialize* or G_New.

Parameters
Combo_Box
Model

A Gtk.Tree_Model.Gtk_Tree_Model.

Gtk_New_With_Model_And_Entry

procedure Gtk_New_With_Model_And_Entry
   (Combo_Box : out Gtk_Combo_Box;
    Model     : Gtk.Tree_Model.Gtk_Tree_Model)

Creates a new empty Gtk.Combo_Box.Gtk_Combo_Box with an entry and with the model initialized to Model. Since: gtk+ 2.24 Initialize_With_Model_And_Entry does nothing if the object was already created with another call to Initialize* or G_New.

Parameters
Combo_Box
Model

A Gtk.Tree_Model.Gtk_Tree_Model

Gtk_Tree_View_Row_Separator_Func

type Gtk_Tree_View_Row_Separator_Func is access function
  (Model : Gtk.Tree_Model.Gtk_Tree_Model;
   Iter  : Gtk.Tree_Model.Gtk_Tree_Iter) return Boolean;

Function type for determining whether the row pointed to by Iter should be rendered as a separator. A common way to implement this is to have a boolean column in the model, whose values the Gtk.Tree_View.Gtk_Tree_View_Row_Separator_Func returns.

Parameters
Model

the Gtk.Tree_Model.Gtk_Tree_Model

Iter

a Gtk.Tree_Model.Gtk_Tree_Iter pointing at a row in Model

Return Value

True if the row is a separator

Has_Entry_Property

Has_Entry_Property : constant Glib.Properties.Property_Boolean;

Whether the combo box has an entry.

Has_Frame_Property

Has_Frame_Property : constant Glib.Properties.Property_Boolean;

The has-frame property controls whether a frame is drawn around the entry.

Id_Column_Property

Id_Column_Property : constant Glib.Properties.Property_Int;

The column in the combo box's model that provides string IDs for the values in the model, if != -1.

Implements_Gtk_Buildable

package Implements_Gtk_Buildable is new Glib.Types.Implements
  (Gtk.Buildable.Gtk_Buildable, Gtk_Combo_Box_Record, Gtk_Combo_Box);

Implements_Gtk_Cell_Editable

package Implements_Gtk_Cell_Editable is new Glib.Types.Implements
  (Gtk.Cell_Editable.Gtk_Cell_Editable, Gtk_Combo_Box_Record, Gtk_Combo_Box);

Implements_Gtk_Cell_Layout

package Implements_Gtk_Cell_Layout is new Glib.Types.Implements
  (Gtk.Cell_Layout.Gtk_Cell_Layout, Gtk_Combo_Box_Record, Gtk_Combo_Box);

Initialize

procedure Initialize
   (Combo_Box : not null access Gtk_Combo_Box_Record'Class)

Creates a new empty Gtk.Combo_Box.Gtk_Combo_Box. Since: gtk+ 2.4 Initialize does nothing if the object was already created with another call to Initialize* or G_New.

Parameters
Combo_Box

Initialize_With_Area

procedure Initialize_With_Area
   (Combo_Box : not null access Gtk_Combo_Box_Record'Class;
    Area      : not null access Gtk.Cell_Area.Gtk_Cell_Area_Record'Class)

Creates a new empty Gtk.Combo_Box.Gtk_Combo_Box using Area to layout cells. Initialize_With_Area does nothing if the object was already created with another call to Initialize* or G_New.

Parameters
Combo_Box
Area

the Gtk.Cell_Area.Gtk_Cell_Area to use to layout cell renderers

Initialize_With_Area_And_Entry

procedure Initialize_With_Area_And_Entry
   (Combo_Box : not null access Gtk_Combo_Box_Record'Class;
    Area      : not null access Gtk.Cell_Area.Gtk_Cell_Area_Record'Class)

Creates a new empty Gtk.Combo_Box.Gtk_Combo_Box with an entry. The new combo box will use Area to layout cells. Initialize_With_Area_And_Entry does nothing if the object was already created with another call to Initialize* or G_New.

Parameters
Combo_Box
Area

the Gtk.Cell_Area.Gtk_Cell_Area to use to layout cell renderers

Initialize_With_Entry

procedure Initialize_With_Entry
   (Combo_Box : not null access Gtk_Combo_Box_Record'Class)

Creates a new empty Gtk.Combo_Box.Gtk_Combo_Box with an entry. Since: gtk+ 2.24 Initialize_With_Entry does nothing if the object was already created with another call to Initialize* or G_New.

Parameters
Combo_Box

Initialize_With_Model

procedure Initialize_With_Model
   (Combo_Box : not null access Gtk_Combo_Box_Record'Class;
    Model     : Gtk.Tree_Model.Gtk_Tree_Model)

Creates a new Gtk.Combo_Box.Gtk_Combo_Box with the model initialized to Model. Since: gtk+ 2.4 Initialize_With_Model does nothing if the object was already created with another call to Initialize* or G_New.

Parameters
Combo_Box
Model

A Gtk.Tree_Model.Gtk_Tree_Model.

Initialize_With_Model_And_Entry

procedure Initialize_With_Model_And_Entry
   (Combo_Box : not null access Gtk_Combo_Box_Record'Class;
    Model     : Gtk.Tree_Model.Gtk_Tree_Model)

Creates a new empty Gtk.Combo_Box.Gtk_Combo_Box with an entry and with the model initialized to Model. Since: gtk+ 2.24 Initialize_With_Model_And_Entry does nothing if the object was already created with another call to Initialize* or G_New.

Parameters
Combo_Box
Model

A Gtk.Tree_Model.Gtk_Tree_Model

Model_Property

Model_Property : constant Glib.Properties.Property_Interface;

Type: Gtk.Tree_Model.Gtk_Tree_Model The model from which the combo box takes the values shown in the list.

On_Changed

procedure On_Changed
   (Self  : not null access Gtk_Combo_Box_Record;
    Call  : Cb_GObject_Void;
    Slot  : not null access Glib.Object.GObject_Record'Class;
    After : Boolean := False)

The changed signal is emitted when the active item is changed. The can be due to the user selecting a different item from the list, or due to a call to Gtk.Combo_Box.Set_Active_Iter. It will also be emitted while typing into the entry of a combo box with an entry.

Parameters
Self
Call
Slot
After

On_Changed

procedure On_Changed
   (Self  : not null access Gtk_Combo_Box_Record;
    Call  : Cb_Gtk_Combo_Box_Void;
    After : Boolean := False)

The changed signal is emitted when the active item is changed. The can be due to the user selecting a different item from the list, or due to a call to Gtk.Combo_Box.Set_Active_Iter. It will also be emitted while typing into the entry of a combo box with an entry.

Parameters
Self
Call
After

On_Format_Entry_Text

procedure On_Format_Entry_Text
   (Self  : not null access Gtk_Combo_Box_Record;
    Call  : Cb_GObject_UTF8_String_UTF8_String;
    Slot  : not null access Glib.Object.GObject_Record'Class;
    After : Boolean := False)

For combo boxes that are created with an entry (See GtkComboBox:has-entry).

A signal which allows you to change how the text displayed in a combo box's entry is displayed.

Connect a signal handler which returns an allocated string representing Path. That string will then be used to set the text in the combo box's entry. The default signal handler uses the text from the GtkComboBox::entry-text-column model column.

Here's an example signal handler which fetches data from the model and displays it in the entry.

static gchar*
format_entry_text_callback (GtkComboBox *combo,
                            const gchar *path,
                            gpointer     user_data)
{
  GtkTreeIter iter;
  GtkTreeModel model;
  gdouble      value;

  model = gtk_combo_box_get_model (combo);

  gtk_tree_model_get_iter_from_string (model, &iter, path);
  gtk_tree_model_get (model, &iter,
                      THE_DOUBLE_VALUE_COLUMN, &value,
                      -1);

  return g_strdup_printf ("%g", value);
}

Callback parameters: -- @param Path the GtkTreePath string from the combo box's current model -- to format text for

Parameters
Self
Call
Slot
After

On_Format_Entry_Text

procedure On_Format_Entry_Text
   (Self  : not null access Gtk_Combo_Box_Record;
    Call  : Cb_Gtk_Combo_Box_UTF8_String_UTF8_String;
    After : Boolean := False)

For combo boxes that are created with an entry (See GtkComboBox:has-entry).

A signal which allows you to change how the text displayed in a combo box's entry is displayed.

Connect a signal handler which returns an allocated string representing Path. That string will then be used to set the text in the combo box's entry. The default signal handler uses the text from the GtkComboBox::entry-text-column model column.

Here's an example signal handler which fetches data from the model and displays it in the entry.

static gchar*
format_entry_text_callback (GtkComboBox *combo,
                            const gchar *path,
                            gpointer     user_data)
{
  GtkTreeIter iter;
  GtkTreeModel model;
  gdouble      value;

  model = gtk_combo_box_get_model (combo);

  gtk_tree_model_get_iter_from_string (model, &iter, path);
  gtk_tree_model_get (model, &iter,
                      THE_DOUBLE_VALUE_COLUMN, &value,
                      -1);

  return g_strdup_printf ("%g", value);
}

Callback parameters: -- @param Path the GtkTreePath string from the combo box's current model -- to format text for

Parameters
Self
Call
After

On_Move_Active

procedure On_Move_Active
   (Self  : not null access Gtk_Combo_Box_Record;
    Call  : Cb_GObject_Gtk_Scroll_Type_Void;
    Slot  : not null access Glib.Object.GObject_Record'Class;
    After : Boolean := False)

The ::move-active signal is a [keybinding signal][GtkBindingSignal] which gets emitted to move the active selection.

Parameters
Self
Call
Slot
After

On_Move_Active

procedure On_Move_Active
   (Self  : not null access Gtk_Combo_Box_Record;
    Call  : Cb_Gtk_Combo_Box_Gtk_Scroll_Type_Void;
    After : Boolean := False)

The ::move-active signal is a [keybinding signal][GtkBindingSignal] which gets emitted to move the active selection.

Parameters
Self
Call
After

On_Popdown

procedure On_Popdown
   (Self  : not null access Gtk_Combo_Box_Record;
    Call  : Cb_GObject_Boolean;
    Slot  : not null access Glib.Object.GObject_Record'Class;
    After : Boolean := False)

The ::popdown signal is a [keybinding signal][GtkBindingSignal] which gets emitted to popdown the combo box list.

The default bindings for this signal are Alt+Up and Escape.

Parameters
Self
Call
Slot
After

On_Popdown

procedure On_Popdown
   (Self  : not null access Gtk_Combo_Box_Record;
    Call  : Cb_Gtk_Combo_Box_Boolean;
    After : Boolean := False)

The ::popdown signal is a [keybinding signal][GtkBindingSignal] which gets emitted to popdown the combo box list.

The default bindings for this signal are Alt+Up and Escape.

Parameters
Self
Call
After

On_Popup

procedure On_Popup
   (Self  : not null access Gtk_Combo_Box_Record;
    Call  : Cb_GObject_Void;
    Slot  : not null access Glib.Object.GObject_Record'Class;
    After : Boolean := False)

The ::popup signal is a [keybinding signal][GtkBindingSignal] which gets emitted to popup the combo box list.

The default binding for this signal is Alt+Down.

Parameters
Self
Call
Slot
After

On_Popup

procedure On_Popup
   (Self  : not null access Gtk_Combo_Box_Record;
    Call  : Cb_Gtk_Combo_Box_Void;
    After : Boolean := False)

The ::popup signal is a [keybinding signal][GtkBindingSignal] which gets emitted to popup the combo box list.

The default binding for this signal is Alt+Down.

Parameters
Self
Call
After

Pack_End

procedure Pack_End
   (Cell_Layout : not null access Gtk_Combo_Box_Record;
    Cell        : not null access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class;
    Expand      : Boolean)
Parameters
Cell_Layout
Cell
Expand

Pack_Start

procedure Pack_Start
   (Cell_Layout : not null access Gtk_Combo_Box_Record;
    Cell        : not null access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class;
    Expand      : Boolean)
Parameters
Cell_Layout
Cell
Expand

Popdown

procedure Popdown (Combo_Box : not null access Gtk_Combo_Box_Record)

Hides the menu or dropdown list of Combo_Box. This function is mostly intended for use by accessibility technologies; applications should have little use for it. Since: gtk+ 2.4

Parameters
Combo_Box

Popup

procedure Popup (Combo_Box : not null access Gtk_Combo_Box_Record)

Pops up the menu or dropdown list of Combo_Box. This function is mostly intended for use by accessibility technologies; applications should have little use for it. Before calling this, Combo_Box must be mapped, or nothing will happen. Since: gtk+ 2.4

Parameters
Combo_Box

Popup_Fixed_Width_Property

Popup_Fixed_Width_Property : constant Glib.Properties.Property_Boolean;

Whether the popup's width should be a fixed width matching the allocated width of the combo box.

Popup_Shown_Property

Popup_Shown_Property : constant Glib.Properties.Property_Boolean;

Whether the combo boxes dropdown is popped up. Note that this property is mainly useful, because it allows you to connect to notify::popup-shown.

Remove_Widget

procedure Remove_Widget
   (Cell_Editable : not null access Gtk_Combo_Box_Record)
Parameters
Cell_Editable

Reorder

procedure Reorder
   (Cell_Layout : not null access Gtk_Combo_Box_Record;
    Cell        : not null access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class;
    Position    : Glib.Gint)
Parameters
Cell_Layout
Cell
Position

Row_Span_Column_Property

Row_Span_Column_Property : constant Glib.Properties.Property_Int;

If this is set to a non-negative value, it must be the index of a column of type G_TYPE_INT in the model. The value in that column for each item will determine how many rows that item will span in the popup. Therefore, values in this column must be greater than zero.

Set_Active

procedure Set_Active
   (Combo_Box : not null access Gtk_Combo_Box_Record;
    Index     : Glib.Gint)

Sets the active item of Combo_Box to be the item at Index. Since: gtk+ 2.4

Parameters
Combo_Box
Index

An index in the model passed during construction, or -1 to have no active item

Set_Active_Id

function Set_Active_Id
   (Combo_Box : not null access Gtk_Combo_Box_Record;
    Active_Id : UTF8_String := "") return Boolean

Changes the active row of Combo_Box to the one that has an ID equal to Active_Id, or unsets the active row if Active_Id is null. Rows having a null ID string cannot be made active by this function. If the Gtk.Combo_Box.Gtk_Combo_Box:id-column property of Combo_Box is unset or if no row has the given ID then the function does nothing and returns False. Since: gtk+ 3.0

Parameters
Combo_Box
Active_Id

the ID of the row to select, or null

Return Value

True if a row with a matching ID was found. If a null Active_Id was given to unset the active row, the function always returns True.

Set_Active_Iter

procedure Set_Active_Iter
   (Combo_Box : not null access Gtk_Combo_Box_Record;
    Iter      : Gtk.Tree_Model.Gtk_Tree_Iter)

Sets the current active item to be the one referenced by Iter, or unsets the active item if Iter is null. Since: gtk+ 2.4

Parameters
Combo_Box
Iter

The Gtk.Tree_Model.Gtk_Tree_Iter, or null

Set_Add_Tearoffs

procedure Set_Add_Tearoffs
   (Combo_Box    : not null access Gtk_Combo_Box_Record;
    Add_Tearoffs : Boolean)

Sets whether the popup menu should have a tearoff menu item. Since: gtk+ 2.6 Deprecated since 3.10, 1

Parameters
Combo_Box
Add_Tearoffs

True to add tearoff menu items

Set_Button_Sensitivity

procedure Set_Button_Sensitivity
   (Combo_Box   : not null access Gtk_Combo_Box_Record;
    Sensitivity : Gtk.Enums.Gtk_Sensitivity_Type)

Sets whether the dropdown button of the combo box should be always sensitive (Gtk.Enums.Sensitivity_On), never sensitive (Gtk.Enums.Sensitivity_Off) or only if there is at least one item to display (Gtk.Enums.Sensitivity_Auto). Since: gtk+ 2.14

Parameters
Combo_Box
Sensitivity

specify the sensitivity of the dropdown button

Set_Cell_Data_Func

procedure Set_Cell_Data_Func
   (Cell_Layout : not null access Gtk_Combo_Box_Record;
    Cell        : not null access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class;
    Func        : Gtk_Cell_Layout_Data_Func)

Sets the Gtk_Cell_Layout_Data_Func to use for Cell_Layout. This function is used instead of the standard attributes mapping for setting the column value, and should set the value of Cell_Layout's cell renderer(s) as appropriate. Func may be null to remove a previously set function. Since: gtk+ 2.4

Parameters
Cell_Layout
Cell

a Gtk.Cell_Renderer.Gtk_Cell_Renderer

Func

the Gtk_Cell_Layout_Data_Func to use, or null

Set_Column_Span_Column

procedure Set_Column_Span_Column
   (Combo_Box   : not null access Gtk_Combo_Box_Record;
    Column_Span : Glib.Gint)

Sets the column with column span information for Combo_Box to be Column_Span. The column span column contains integers which indicate how many columns an item should span. Since: gtk+ 2.4

Parameters
Combo_Box
Column_Span

A column in the model passed during construction

Set_Entry_Text_Column

procedure Set_Entry_Text_Column
   (Combo_Box   : not null access Gtk_Combo_Box_Record;
    Text_Column : Glib.Gint)

Sets the model column which Combo_Box should use to get strings from to be Text_Column. The column Text_Column in the model of Combo_Box must be of type G_TYPE_STRING. This is only relevant if Combo_Box has been created with Gtk.Combo_Box.Gtk_Combo_Box:has-entry as True. Since: gtk+ 2.24

Parameters
Combo_Box
Text_Column

A column in Model to get the strings from for the internal entry

Set_Focus_On_Click

procedure Set_Focus_On_Click
   (Combo_Box      : not null access Gtk_Combo_Box_Record;
    Focus_On_Click : Boolean)

Sets whether the combo box will grab focus when it is clicked with the mouse. Making mouse clicks not grab focus is useful in places like toolbars where you don't want the keyboard focus removed from the main area of the application. Since: gtk+ 2.6 Deprecated since 3.20, 1

Parameters
Combo_Box
Focus_On_Click

whether the combo box grabs focus when clicked with the mouse

Set_Id_Column

procedure Set_Id_Column
   (Combo_Box : not null access Gtk_Combo_Box_Record;
    Id_Column : Glib.Gint)

Sets the model column which Combo_Box should use to get string IDs for values from. The column Id_Column in the model of Combo_Box must be of type G_TYPE_STRING. Since: gtk+ 3.0

Parameters
Combo_Box
Id_Column

A column in Model to get string IDs for values from

Set_Model

procedure Set_Model
   (Combo_Box : not null access Gtk_Combo_Box_Record;
    Model     : Gtk.Tree_Model.Gtk_Tree_Model)

Sets the model used by Combo_Box to be Model. Will unset a previously set model (if applicable). If model is null, then it will unset the model. Note that this function does not clear the cell renderers, you have to call Gtk.Cell_Layout.Clear yourself if you need to set up different cell renderers for the new model. Since: gtk+ 2.4

Parameters
Combo_Box
Model

A Gtk.Tree_Model.Gtk_Tree_Model

Set_Popup_Fixed_Width

procedure Set_Popup_Fixed_Width
   (Combo_Box : not null access Gtk_Combo_Box_Record;
    Fixed     : Boolean)

Specifies whether the popup's width should be a fixed width matching the allocated width of the combo box. Since: gtk+ 3.0

Parameters
Combo_Box
Fixed

whether to use a fixed popup width

Set_Row_Separator_Func

procedure Set_Row_Separator_Func
   (Combo_Box : not null access Gtk_Combo_Box_Record;
    Func      : Gtk.Tree_View.Gtk_Tree_View_Row_Separator_Func)

Sets the row separator function, which is used to determine whether a row should be drawn as a separator. If the row separator function is null, no separators are drawn. This is the default value. Since: gtk+ 2.6

Parameters
Combo_Box
Func

a Gtk.Tree_View.Gtk_Tree_View_Row_Separator_Func

Set_Row_Span_Column

procedure Set_Row_Span_Column
   (Combo_Box : not null access Gtk_Combo_Box_Record;
    Row_Span  : Glib.Gint)

Sets the column with row span information for Combo_Box to be Row_Span. The row span column contains integers which indicate how many rows an item should span. Since: gtk+ 2.4

Parameters
Combo_Box
Row_Span

A column in the model passed during construction.

Set_Title

procedure Set_Title
   (Combo_Box : not null access Gtk_Combo_Box_Record;
    Title     : UTF8_String)

Sets the menu's title in tearoff mode. Since: gtk+ 2.10 Deprecated since 3.10, 1

Parameters
Combo_Box
Title

a title for the menu in tearoff mode

Set_Wrap_Width

procedure Set_Wrap_Width
   (Combo_Box : not null access Gtk_Combo_Box_Record;
    Width     : Glib.Gint)

Sets the wrap width of Combo_Box to be Width. The wrap width is basically the preferred number of columns when you want the popup to be layed out in a table. Since: gtk+ 2.4

Parameters
Combo_Box
Width

Preferred number of columns

Signal_Changed

Signal_Changed : constant Glib.Signal_Name := "changed";

The changed signal is emitted when the active item is changed. The can be due to the user selecting a different item from the list, or due to a call to Gtk.Combo_Box.Set_Active_Iter. It will also be emitted while typing into the entry of a combo box with an entry.

Signal_Format_Entry_Text

Signal_Format_Entry_Text : constant Glib.Signal_Name := "format-entry-text";

For combo boxes that are created with an entry (See GtkComboBox:has-entry).

A signal which allows you to change how the text displayed in a combo box's entry is displayed.

Connect a signal handler which returns an allocated string representing Path. That string will then be used to set the text in the combo box's entry. The default signal handler uses the text from the GtkComboBox::entry-text-column model column.

Here's an example signal handler which fetches data from the model and displays it in the entry.

static gchar*
format_entry_text_callback (GtkComboBox *combo,
                            const gchar *path,
                            gpointer     user_data)
{
  GtkTreeIter iter;
  GtkTreeModel model;
  gdouble      value;

  model = gtk_combo_box_get_model (combo);

  gtk_tree_model_get_iter_from_string (model, &iter, path);
  gtk_tree_model_get (model, &iter,
                      THE_DOUBLE_VALUE_COLUMN, &value,
                      -1);

  return g_strdup_printf ("%g", value);
}

Callback parameters: -- @param Path the GtkTreePath string from the combo box's current model -- to format text for

Signal_Move_Active

Signal_Move_Active : constant Glib.Signal_Name := "move-active";

The ::move-active signal is a [keybinding signal][GtkBindingSignal] which gets emitted to move the active selection.

Signal_Popdown

Signal_Popdown : constant Glib.Signal_Name := "popdown";

The ::popdown signal is a [keybinding signal][GtkBindingSignal] which gets emitted to popdown the combo box list.

The default bindings for this signal are Alt+Up and Escape.

Signal_Popup

Signal_Popup : constant Glib.Signal_Name := "popup";

The ::popup signal is a [keybinding signal][GtkBindingSignal] which gets emitted to popup the combo box list.

The default binding for this signal is Alt+Down.

Start_Editing

procedure Start_Editing
   (Cell_Editable : not null access Gtk_Combo_Box_Record;
    Event         : Gdk.Event.Gdk_Event)
Parameters
Cell_Editable
Event

Tearoff_Title_Property

Tearoff_Title_Property : constant Glib.Properties.Property_String;

A title that may be displayed by the window manager when the popup is torn-off.

Wrap_Width_Property

Wrap_Width_Property : constant Glib.Properties.Property_Int;

If wrap-width is set to a positive value, items in the popup will be laid out along multiple columns, starting a new row on reaching the wrap width.