Class: Gtk::ComboBox
- Extended by:
- GLib::Deprecatable
- Defined in:
- lib/gtk4/combo-box.rb,
lib/gtk4/deprecated.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#active ⇒ Integer
The item which is currently active.
-
#active=(active) ⇒ Integer
The item which is currently active.
-
#active_id ⇒ String
The value of the ID column of the active row.
-
#active_id=(active_id) ⇒ String
The value of the ID column of the active row.
- #active_iter ⇒ Object
-
#active_iter=(iter) ⇒ nil
Sets the current active item to be the one referenced by iter.
- #active_iter_raw ⇒ Object
-
#button_sensitivity ⇒ Gtk::SensitivityType
Whether the dropdown button is sensitive when the model is empty.
-
#button_sensitivity=(button_sensitivity) ⇒ Gtk::SensitivityType
Whether the dropdown button is sensitive when the model is empty.
-
#child ⇒ Gtk::Widget
The child widget.
-
#child=(child) ⇒ Gtk::Widget
The child widget.
-
#entry_text_column ⇒ Integer
The model column to associate with strings from the entry.
-
#entry_text_column=(entry_text_column) ⇒ Integer
The model column to associate with strings from the entry.
-
#get_active_iter(iter) ⇒ Boolean
Sets iter to point to the currently active item.
-
#has_entry ⇒ Boolean
Returns whether the combo box has an entry.
-
#has_entry=(has_entry) ⇒ Boolean
Whether the combo box has an entry.
-
#has_entry? ⇒ Boolean
Whether the combo box has an entry.
-
#has_frame=(has_frame) ⇒ Boolean
The
has-frameproperty controls whether a frame is drawn around the entry. -
#has_frame? ⇒ Boolean
The
has-frameproperty controls whether a frame is drawn around the entry. -
#id_column ⇒ Integer
The model column that provides string IDs for the values in the model, if != -1.
-
#id_column=(id_column) ⇒ Integer
The model column that provides string IDs for the values in the model, if != -1.
-
#initialize(options = {}) ⇒ Gtk::Widget
constructor
Creates a new empty
GtkComboBoxwith an entry and a model. -
#initialize_raw ⇒ Gtk::Widget
Creates a new empty
GtkComboBoxwith an entry and a model. -
#model ⇒ Gtk::TreeModel
The model from which the combo box takes its values.
-
#model=(model) ⇒ Gtk::TreeModel
The model from which the combo box takes its values.
-
#popdown ⇒ nil
Hides the menu or dropdown list of combo_box.
-
#popup ⇒ nil
Pops up the menu or dropdown list of combo_box.
-
#popup_fixed_width ⇒ Boolean
Gets whether the popup uses a fixed width.
-
#popup_fixed_width=(popup_fixed_width) ⇒ Boolean
Whether the popup's width should be a fixed width matching the allocated width of the combo box.
-
#popup_fixed_width? ⇒ Boolean
Whether the popup's width should be a fixed width matching the allocated width of the combo box.
-
#popup_for_device(device) ⇒ nil
Pops up the menu of combo_box.
-
#popup_shown=(popup_shown) ⇒ Boolean
Whether the combo boxes dropdown is popped up.
-
#popup_shown? ⇒ Boolean
Whether the combo boxes dropdown is popped up.
-
#row_separator_func ⇒ Gtk::TreeViewRowSeparatorFunc
Returns the current row separator function.
-
#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.
Methods inherited from Widget
#accessible_role, #accessible_role=, #action_set_enabled, #activate, #activate_action, #activate_action_variant, #activate_default, #activate_signal, #activate_signal=, #activate_signal_from_name=, #add_binding, #add_binding_action, #add_binding_signal, #add_controller, #add_css_class, #add_mnemonic_label, #add_shortcut, #add_tick_callback, #allocate, #allocated_baseline, #allocated_height, #allocated_width, #baseline, #bind_template_callback_full, #bind_template_child, #bind_template_child_full, #can_focus, #can_focus=, #can_focus?, #can_target, #can_target=, #can_target?, #child_focus, #child_visible, #child_visible=, #children, #clipboard, #compute_bounds, #compute_expand, #compute_point, #compute_transform, #contains, #create_pango_context, #create_pango_layout, #css_classes, #css_classes=, #css_name, #css_name=, #cursor, #cursor=, #cursor_from_name=, default_direction, default_direction=, #direction, #direction=, #display, #dispose_template, #drag_check_threshold, #error_bell, #first_child, #focus_child, #focus_child=, #focus_on_click, #focus_on_click=, #focus_on_click?, #focusable, #focusable=, #focusable?, #font_map, #font_map=, #font_options, #font_options=, #frame_clock, #get_allocation, #get_ancestor, #get_color, #get_preferred_size, #get_size, #get_size_request, #get_template_child, #grab_focus, #halign, #halign=, #has_css_class, #has_default, #has_default=, #has_default?, #has_focus, #has_focus=, #has_focus?, #has_tooltip, #has_tooltip=, #has_tooltip?, #has_visible_focus, have_template?, #height, #height_request, #height_request=, #hexpand, #hexpand=, #hexpand?, #hexpand_set, #hexpand_set=, #hexpand_set?, #hide, #in_destruction, #init_template, #insert_action_group, #insert_action_group_raw, #insert_after, #insert_before, #install_action, #install_property_action, #is_ancestor, #is_drawable, #is_focus, #is_sensitive, #is_visible, #keynav_failed, #last_child, #layout_manager, #layout_manager=, #layout_manager_type, #layout_manager_type=, #list_mnemonic_labels, #map, #mapped, #margin_bottom, #margin_bottom=, #margin_end, #margin_end=, #margin_start, #margin_start=, #margin_top, #margin_top=, #measure, #mnemonic_activate, #name, #name=, #native, #next_sibling, #observe_children, #observe_controllers, #opacity, #opacity=, #overflow, #overflow=, #pango_context, #parent, #parent=, #pick, #prev_sibling, #primary_clipboard, #query_action, #queue_allocate, #queue_draw, #queue_resize, #realize, #realized, #receives_default, #receives_default=, #receives_default?, #remove_controller, #remove_css_class, #remove_mnemonic_label, #remove_tick_callback, #request_mode, #root, #root=, #scale_factor, #scale_factor=, #sensitive, #sensitive=, #sensitive?, #set_size_request, #set_size_request_raw, #set_state_flags, #set_template, #set_template_raw, #settings, #should_layout, #show, #size_allocate, #snapshot_child, #state_flags, #style_context, #style_context_raw, #template=, template_children, #template_from_resource=, #template_scope=, #tooltip_markup, #tooltip_markup=, #tooltip_text, #tooltip_text=, #translate_coordinates, #translate_coordinates_raw, #trigger_tooltip_query, #unmap, #unparent, #unrealize, #unset_state_flags, #valign, #valign=, #vexpand, #vexpand=, #vexpand?, #vexpand_set, #vexpand_set=, #vexpand_set?, #visible, #visible=, #visible?, #width, #width_request, #width_request=
Constructor Details
#initialize(options = {}) ⇒ Gtk::Widget
Creates a new empty GtkComboBox with an entry and a model.
See also [ctorGtk.ComboBox.new_with_entry].
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/gtk4/combo-box.rb', line 20 def initialize(={}) entry = [:entry] model = [:model] if entry if model initialize_new_with_model_and_entry(model) else initialize_new_with_entry end else if model initialize_new_with_model(model) else initialize_new end end end |
Instance Method Details
#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)[0], where path is the
[structGtk.TreePath] of the active item.
#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)[0], where path is the
[structGtk.TreePath] of the active item.
#active_id ⇒ String
The value of the ID column of the active row.
#active_id=(active_id) ⇒ String
The value of the ID column of the active row.
#active_iter ⇒ Object
40 41 42 43 44 45 46 47 48 |
# File 'lib/gtk4/combo-box.rb', line 40 def active_iter found, iter = active_iter_raw if found iter.model = model iter else nil end end |
#active_iter=(iter) ⇒ nil
Sets the current active item to be the one referenced by iter.
If iter is nil, the active item is unset.
#active_iter_raw ⇒ Object
39 |
# File 'lib/gtk4/combo-box.rb', line 39 alias_method :active_iter_raw, :active_iter |
#button_sensitivity ⇒ Gtk::SensitivityType
Whether the dropdown button is sensitive when the model is empty.
#button_sensitivity=(button_sensitivity) ⇒ Gtk::SensitivityType
Whether the dropdown button is sensitive when the model is empty.
#child ⇒ Gtk::Widget
The child widget.
#child=(child) ⇒ Gtk::Widget
The child widget.
#entry_text_column ⇒ Integer
The model column to associate with strings from the entry.
This is property only relevant if the combo was created with [propertyGtk.ComboBox:has-entry] is true.
#entry_text_column=(entry_text_column) ⇒ Integer
The model column to associate with strings from the entry.
This is property only relevant if the combo was created with [propertyGtk.ComboBox:has-entry] is true.
#get_active_iter(iter) ⇒ Boolean
Sets iter to point to the currently active item.
If no item is active, iter is left unchanged.
#has_entry ⇒ Boolean
Returns whether the combo box has an entry.
#has_entry=(has_entry) ⇒ Boolean
Whether the combo box has an entry.
#has_entry? ⇒ Boolean
Whether the combo box has an entry.
#has_frame=(has_frame) ⇒ Boolean
The has-frame property controls whether a frame is drawn around the entry.
#has_frame? ⇒ Boolean
The has-frame property controls whether a frame is drawn around the entry.
#id_column ⇒ Integer
The model column that provides string IDs for the values in the model, if != -1.
#id_column=(id_column) ⇒ Integer
The model column that provides string IDs for the values in the model, if != -1.
#initialize_raw ⇒ Gtk::Widget
Creates a new empty GtkComboBox with an entry and a model.
See also [ctorGtk.ComboBox.new_with_entry].
|
|
# File 'lib/gtk4/combo-box.rb', line 19
|
#model ⇒ Gtk::TreeModel
The model from which the combo box takes its values.
#model=(model) ⇒ Gtk::TreeModel
The model from which the combo box takes its values.
#popdown ⇒ nil
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.
#popup ⇒ 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.
#popup_fixed_width ⇒ Boolean
Gets whether the popup uses a fixed width.
#popup_fixed_width=(popup_fixed_width) ⇒ Boolean
Whether the popup's width should be a fixed width matching the allocated width of the combo box.
#popup_fixed_width? ⇒ Boolean
Whether the popup's width should be a fixed width matching the allocated width of the combo box.
#popup_for_device(device) ⇒ nil
Pops up the menu of combo_box.
Note that currently this does not do anything with the device, as it was previously only used for list-mode combo boxes, and those were removed in GTK 4. However, it is retained in case similar functionality is added back later.
#popup_shown=(popup_shown) ⇒ 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.
#popup_shown? ⇒ 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.
#row_separator_func ⇒ Gtk::TreeViewRowSeparatorFunc
Returns the current row separator function.
#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.