Class: Gtk::ComboBox

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Instance Method Details

#activeInteger

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)`, where `path` is the Gtk::TreePath of the active item.

Returns:

  • (Integer)

    active

#active=(active) ⇒ Integer

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)`, where `path` is the Gtk::TreePath of the active item.

Parameters:

  • active (Integer)

Returns:

  • (Integer)

    active

  • (Integer)

    active

#active_idString

The value of the ID column of the active row.

Returns:

  • (String)

    active-id

#active_id=(active_id) ⇒ String

The value of the ID column of the active row.

Parameters:

  • active_id (String)

Returns:

  • (String)

    active-id

  • (String)

    active-id

#active_iter=(iter) ⇒ nil

Sets the current active item to be the one referenced by iter, or unsets the active item if iter is nil.

Parameters:

  • iter (Gtk::TreeIter)

    The Gtk::TreeIter, or nil

Returns:

  • (nil)

#add_tearoffsTrueClass

Gets the current value of the :add-tearoffs property.

Returns:

  • (TrueClass)

    the current value of the :add-tearoffs property.

#add_tearoffs=(add_tearoffs) ⇒ TrueClass

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

Note that this only affects menu style combo boxes.

Parameters:

  • add_tearoffs (TrueClass)

Returns:

  • (TrueClass)

    add-tearoffs

  • (TrueClass)

    add-tearoffs

#add_tearoffs?TrueClass

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

Note that this only affects menu style combo boxes.

Returns:

  • (TrueClass)

    add-tearoffs

#button_sensitivityGtk::SensitivityType

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

Returns:

#button_sensitivity=(button_sensitivity) ⇒ Gtk::SensitivityType

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

Parameters:

Returns:

#cell_areaGtk::CellArea

The Gtk::CellArea used to layout cell renderers for this combo box.

If no area is specified when creating the combo box with gtk_combo_box_new_with_area() a horizontally oriented Gtk::CellAreaBox will be used.

Returns:

#cell_area=(cell_area) ⇒ Gtk::CellArea

The Gtk::CellArea used to layout cell renderers for this combo box.

If no area is specified when creating the combo box with gtk_combo_box_new_with_area() a horizontally oriented Gtk::CellAreaBox will be used.

Parameters:

Returns:

#column_span_columnInteger

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::ComboBox:wrap-width.

Returns:

  • (Integer)

    column-span-column

#column_span_column=(column_span_column) ⇒ Integer

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::ComboBox:wrap-width.

Parameters:

  • column_span_column (Integer)

Returns:

  • (Integer)

    column-span-column

  • (Integer)

    column-span-column

#entry_text_columnInteger

The column in the combo box’s model to associate with strings from the entry if the combo was created with Gtk::ComboBox:has-entry = true.

Returns:

  • (Integer)

    entry-text-column

#entry_text_column=(entry_text_column) ⇒ Integer

The column in the combo box’s model to associate with strings from the entry if the combo was created with Gtk::ComboBox:has-entry = true.

Parameters:

  • entry_text_column (Integer)

Returns:

  • (Integer)

    entry-text-column

  • (Integer)

    entry-text-column

#focus_on_clickTrueClass

Returns whether the combo box grabs focus when it is clicked with the mouse. See gtk_combo_box_set_focus_on_click().

Returns:

  • (TrueClass)

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

#focus_on_click=(focus_on_click) ⇒ nil

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.

Parameters:

  • focus_on_click (TrueClass)

    whether the combo box grabs focus when clicked with the mouse

Returns:

  • (nil)

#get_active_iter(iter) ⇒ TrueClass

Sets iter to point to the currently active item, if any item is active. Otherwise, iter is left unchanged.

Parameters:

  • iter (Gtk::TreeIter)

    A Gtk::TreeIter

Returns:

  • (TrueClass)

    true if iter was set, false otherwise

#has_entryTrueClass

Returns whether the combo box has an entry.

Returns:

  • (TrueClass)

    whether there is an entry in combo_box.

#has_entry=(has_entry) ⇒ TrueClass

Whether the combo box has an entry.

Parameters:

  • has_entry (TrueClass)

Returns:

  • (TrueClass)

    has-entry

  • (TrueClass)

    has-entry

#has_entry?TrueClass

Whether the combo box has an entry.

Returns:

  • (TrueClass)

    has-entry

#has_frame=(has_frame) ⇒ TrueClass

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

Parameters:

  • has_frame (TrueClass)

Returns:

  • (TrueClass)

    has-frame

  • (TrueClass)

    has-frame

#has_frame?TrueClass

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

Returns:

  • (TrueClass)

    has-frame

#id_columnInteger

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

Returns:

  • (Integer)

    id-column

#id_column=(id_column) ⇒ Integer

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

Parameters:

  • id_column (Integer)

Returns:

  • (Integer)

    id-column

  • (Integer)

    id-column

#modelGtk::TreeModel

The model from which the combo box takes the values shown in the list.

Returns:

#model=(model) ⇒ Gtk::TreeModel

The model from which the combo box takes the values shown in the list.

Parameters:

Returns:

#newGtk::Widget

Creates a new empty Gtk::ComboBox.

Returns:

#new_with_area(area) ⇒ Gtk::Widget

Creates a new empty Gtk::ComboBox using area to layout cells.

Parameters:

  • area (Gtk::CellArea)

    the Gtk::CellArea to use to layout cell renderers

Returns:

#new_with_area_and_entry(area) ⇒ Gtk::Widget

Creates a new empty Gtk::ComboBox with an entry.

The new combo box will use area to layout cells.

Parameters:

  • area (Gtk::CellArea)

    the Gtk::CellArea to use to layout cell renderers

Returns:

#new_with_entryGtk::Widget

Creates a new empty Gtk::ComboBox with an entry.

Returns:

#new_with_model(model) ⇒ Gtk::Widget

Creates a new Gtk::ComboBox with the model initialized to model.

Parameters:

Returns:

#new_with_model_and_entry(model) ⇒ Gtk::Widget

Creates a new empty Gtk::ComboBox with an entry and with the model initialized to model.

Parameters:

Returns:

#popdownnil

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.

Returns:

  • (nil)

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.

Returns:

  • (nil)

Gets the accessible object corresponding to the combo box’s popup.

This function is mostly intended for use by accessibility technologies; applications should have little use for it.

Returns:

  • (Atk::Object)

    the accessible object corresponding to the combo box’s popup.

Gets whether the popup uses a fixed width matching the allocated width of the combo box.

Returns:

  • (TrueClass)

    true if the popup uses a fixed width

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

Parameters:

  • popup_fixed_width (TrueClass)

Returns:

  • (TrueClass)

    popup-fixed-width

  • (TrueClass)

    popup-fixed-width

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

Returns:

  • (TrueClass)

    popup-fixed-width

Pops up the menu or dropdown list of combo_box, the popup window will be grabbed so only device and its associated pointer/keyboard are the only Gdk::Devices able to send events to it.

Parameters:

Returns:

  • (nil)

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.

Parameters:

  • popup_shown (TrueClass)

Returns:

  • (TrueClass)

    popup-shown

  • (TrueClass)

    popup-shown

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.

Returns:

  • (TrueClass)

    popup-shown

#row_separator_funcGtk::TreeViewRowSeparatorFunc

Returns the current row separator function.

Returns:

  • (Gtk::TreeViewRowSeparatorFunc)

    the current row separator function.

#row_span_columnInteger

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.

Returns:

  • (Integer)

    row-span-column

#row_span_column=(row_span_column) ⇒ Integer

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.

Parameters:

  • row_span_column (Integer)

Returns:

  • (Integer)

    row-span-column

  • (Integer)

    row-span-column

#set_row_separator_func(func, data, destroy) ⇒ nil

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 nil, no separators are drawn. This is the default value.

Parameters:

  • func (Gtk::TreeViewRowSeparatorFunc)

    a Gtk::TreeViewRowSeparatorFunc

  • data (GObject)

    user data to pass to func, or nil

  • destroy (GLib::DestroyNotify)

    destroy notifier for data, or nil

Returns:

  • (nil)

#tearoff_titleString

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

Returns:

  • (String)

    tearoff-title

#tearoff_title=(tearoff_title) ⇒ String

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

Parameters:

  • tearoff_title (String)

Returns:

  • (String)

    tearoff-title

  • (String)

    tearoff-title

#titleString

Gets the current title of the menu in tearoff mode. See gtk_combo_box_set_add_tearoffs(). string which must not be freed.

Returns:

  • (String)

    the menu’s title in tearoff mode. This is an internal copy of the

#title=(title) ⇒ nil

Sets the menu’s title in tearoff mode.

Parameters:

  • title (String)

    a title for the menu in tearoff mode

Returns:

  • (nil)

#wrap_widthInteger

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.

Returns:

  • (Integer)

    wrap-width

#wrap_width=(wrap_width) ⇒ Integer

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.

Parameters:

  • wrap_width (Integer)

Returns:

  • (Integer)

    wrap-width

  • (Integer)

    wrap-width