Description
A
Gtk_Combo_Box is a widget that allows the user to choose from a list of
valid choices. The
Gtk_Combo_Box displays the selected choice. When
activated, the
Gtk_Combo_Box displays a popup which allows the user to make
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 Gtk_Option_Menu, or similar to a Windows-style combo box.
Unlike its predecessors Gtk.Combo.Gtk_Combo and
Gtk.Option_Menu.Gtk_Option_Menu, the Gtk_Combo_Box 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 Gtk_Combo_Box implements the 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.
In addition to the model-view API, Gtk_Combo_Box offers a simple API which
is suitable for text-only combo boxes, and hides the complexity of managing
the data in a model.
Subprograms
-
procedure Gtk_New (Combo : out Gtk_Combo_Box);
procedure Initialize (Combo : access Gtk_Combo_Box_Record'Class);
-
-
-
-
procedure Set_Active
(Combo_Box : access Gtk_Combo_Box_Record; Index : Gint);
function Get_Active
(Combo_Box : access Gtk_Combo_Box_Record) return Gint;
-
-
procedure Set_Wrap_Width
(Combo_Box : access Gtk_Combo_Box_Record; Width : Gint);
function Get_Wrap_Width
(Combo_Box : access Gtk_Combo_Box_Record) return Gint;
-
procedure Set_Add_Tearoffs
(Combo_Box : access Gtk_Combo_Box_Record; Add_Tearoffs : Boolean);
function Get_Add_Tearoffs
(Combo_Box : access Gtk_Combo_Box_Record) return Boolean;
-
procedure Set_Column_Span_Column
(Combo_Box : access Gtk_Combo_Box_Record; Column_Span : Gint);
function Get_Column_Span_Column
(Combo_Box : access Gtk_Combo_Box_Record) return Gint;
-
procedure Set_Row_Span_Column
(Combo_Box : access Gtk_Combo_Box_Record; Row_Span : Gint);
function Get_Row_Span_Column
(Combo_Box : access Gtk_Combo_Box_Record) return Gint;
-
procedure Set_Focus_On_Click
(Combo : access Gtk_Combo_Box_Record;
Focus_On_Click : Boolean);
function Get_Focus_On_Click
(Combo : access Gtk_Combo_Box_Record) return Boolean;
-
Text-only combo boxes
If your combo box only contains text, you do not necessarily have to go
through the more complex use of a Gtk_Tree_Model.
-
procedure Gtk_New_Text (Combo : out Gtk_Combo_Box);
procedure Initialize_Text (Combo : access Gtk_Combo_Box_Record'Class);
-
procedure Append_Text
(Combo_Box : access Gtk_Combo_Box_Record; Text : String);
procedure Prepend_Text
(Combo_Box : access Gtk_Combo_Box_Record; Text : String);
procedure Insert_Text
(Combo_Box : access Gtk_Combo_Box_Record;
Position : Gint;
Text : String);
-
procedure Remove_Text
(Combo_Box : access Gtk_Combo_Box_Record; Position : Gint);
-
function Get_Active_Text
(Combo_Box : access Gtk_Combo_Box_Record) return String;
Programmatic Control
-
procedure Popdown (Combo_Box : access Gtk_Combo_Box_Record);
procedure Popup (Combo_Box : access Gtk_Combo_Box_Record);
Interfaces
This class implements several interfaces. See
Glib.Types
-
-