[−][src]Trait gtk::ComboBoxExt
Required methods
fn get_active_id(&self) -> Option<GString>
Returns the ID of the active row of self
. This value is taken
from the active row and the column specified by the ComboBox:id-column
property of self
(see ComboBoxExt::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 ComboBox:id-column
property of self
is not set, or if
no row is active, or if the active row has a None
ID value, then None
is returned.
Returns
the ID of the active row, or None
fn get_active_iter(&self) -> Option<TreeIter>
Sets iter
to point to the currently active item, if any item is active.
Otherwise, iter
is left unchanged.
iter
A TreeIter
Returns
true
if iter
was set, false
otherwise
fn get_button_sensitivity(&self) -> SensitivityType
Returns whether the combo box sets the dropdown button sensitive or not when there are no items in the model.
Returns
SensitivityType::On
if the dropdown button
is sensitive when the model is empty, SensitivityType::Off
if the button is always insensitive or
SensitivityType::Auto
if it is only sensitive as long as
the model has one item to be selected.
fn get_column_span_column(&self) -> i32
fn get_entry_text_column(&self) -> i32
Returns the column which self
is using to get the strings
from to display in the internal entry.
Returns
A column in the data source model of self
.
fn get_focus_on_click(&self) -> bool
Returns whether the combo box grabs focus when it is clicked
with the mouse. See ComboBoxExt::set_focus_on_click
.
Deprecated since 3.20
Use WidgetExt::get_focus_on_click
instead
Returns
true
if the combo box grabs focus when it is
clicked with the mouse.
fn get_has_entry(&self) -> bool
fn get_id_column(&self) -> i32
Returns the column which self
is using to get string IDs
for values from.
Returns
A column in the data source model of self
.
fn get_model(&self) -> Option<TreeModel>
Returns the TreeModel
which is acting as data source for self
.
Returns
A TreeModel
which was passed
during construction.
fn get_popup_accessible(&self) -> Option<Object>
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
the accessible object corresponding to the combo box’s popup.
fn get_popup_fixed_width(&self) -> bool
Gets whether the popup uses a fixed width matching the allocated width of the combo box.
Returns
true
if the popup uses a fixed width
fn get_row_span_column(&self) -> i32
fn get_wrap_width(&self) -> i32
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.
Returns
the wrap width.
fn popdown(&self)
Hides the menu or dropdown list of self
.
This function is mostly intended for use by accessibility technologies; applications should have little use for it.
fn popup(&self)
Pops up the menu or dropdown list of self
.
This function is mostly intended for use by accessibility technologies; applications should have little use for it.
Before calling this, self
must be mapped, or nothing will happen.
fn popup_for_device(&self, device: &Device)
Pops up the menu or dropdown list of self
, the popup window
will be grabbed so only device
and its associated pointer/keyboard
are the only GdkDevices
able to send events to it.
device
a gdk::Device
fn set_active_id(&self, active_id: Option<&str>) -> bool
Changes the active row of self
to the one that has an ID equal to
active_id
, or unsets the active row if active_id
is None
. Rows having
a None
ID string cannot be made active by this function.
If the ComboBox:id-column
property of self
is unset or if no
row has the given ID then the function does nothing and returns false
.
active_id
the ID of the row to select, or None
Returns
true
if a row with a matching ID was found. If a None
active_id
was given to unset the active row, the function
always returns true
.
fn set_active_iter(&self, iter: Option<&TreeIter>)
Sets the current active item to be the one referenced by iter
, or
unsets the active item if iter
is None
.
iter
The TreeIter
, or None
fn set_button_sensitivity(&self, sensitivity: SensitivityType)
Sets whether the dropdown button of the combo box should be
always sensitive (SensitivityType::On
), never sensitive (SensitivityType::Off
)
or only if there is at least one item to display (SensitivityType::Auto
).
sensitivity
specify the sensitivity of the dropdown button
fn set_column_span_column(&self, column_span: i32)
Sets the column with column span information for self
to be
column_span
. The column span column contains integers which indicate
how many columns an item should span.
column_span
A column in the model passed during construction
fn set_entry_text_column(&self, text_column: i32)
Sets the model column which self
should use to get strings from
to be text_column
. The column text_column
in the model of self
must be of type G_TYPE_STRING
.
This is only relevant if self
has been created with
ComboBox:has-entry
as true
.
text_column
A column in model
to get the strings from for
the internal entry
fn set_focus_on_click(&self, focus_on_click: bool)
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.
Deprecated since 3.20
Use WidgetExt::set_focus_on_click
instead
focus_on_click
whether the combo box grabs focus when clicked with the mouse
fn set_id_column(&self, id_column: i32)
Sets the model column which self
should use to get string IDs
for values from. The column id_column
in the model of self
must be of type G_TYPE_STRING
.
id_column
A column in model
to get string IDs for values from
fn set_model<P: IsA<TreeModel>>(&self, model: Option<&P>)
Sets the model used by self
to be model
. Will unset a previously set
model (if applicable). If model is None
, then it will unset the model.
Note that this function does not clear the cell renderers, you have to
call CellLayout::clear
yourself if you need to set up different
cell renderers for the new model.
model
A TreeModel
fn set_popup_fixed_width(&self, fixed: bool)
Specifies whether the popup’s width should be a fixed width matching the allocated width of the combo box.
fixed
whether to use a fixed popup width
fn set_row_separator_func<P: Fn(&TreeModel, &TreeIter) -> bool + 'static>(
&self,
func: P
)
&self,
func: P
)
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 None
, no separators are drawn. This is the default value.
func
a GtkTreeViewRowSeparatorFunc
data
user data to pass to func
, or None
destroy
destroy notifier for data
, or None
fn set_row_span_column(&self, row_span: i32)
Sets the column with row span information for self
to be row_span
.
The row span column contains integers which indicate how many rows
an item should span.
row_span
A column in the model passed during construction.
fn set_wrap_width(&self, width: i32)
Sets the wrap width of self
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.
width
Preferred number of columns
fn get_property_cell_area(&self) -> Option<CellArea>
The CellArea
used to layout cell renderers for this combo box.
If no area is specified when creating the combo box with ComboBox::new_with_area
a horizontally oriented CellAreaBox
will be used.
fn get_property_has_frame(&self) -> bool
The has-frame property controls whether a frame is drawn around the entry.
fn set_property_has_frame(&self, has_frame: bool)
The has-frame property controls whether a frame is drawn around the entry.
fn get_property_popup_shown(&self) -> bool
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.
fn connect_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
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 ComboBoxExt::set_active_iter
.
It will also be emitted while typing into the entry of a combo box
with an entry.
fn connect_format_entry_text<F: Fn(&Self, &str) -> String + 'static>(
&self,
f: F
) -> SignalHandlerId
&self,
f: F
) -> SignalHandlerId
For combo boxes that are created with an entry (See ComboBox
: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 ComboBox
::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);
}
path
the TreePath
string from the combo box's current model to format text for
Returns
a newly allocated string representing path
for the current ComboBox
model.
fn connect_move_active<F: Fn(&Self, ScrollType) + 'static>(
&self,
f: F
) -> SignalHandlerId
&self,
f: F
) -> SignalHandlerId
The ::move-active signal is a
[keybinding signal][BindingSignal
]
which gets emitted to move the active selection.
scroll_type
a ScrollType
fn emit_move_active(&self, scroll_type: ScrollType)
fn connect_popdown<F: Fn(&Self) -> bool + 'static>(
&self,
f: F
) -> SignalHandlerId
&self,
f: F
) -> SignalHandlerId
The ::popdown signal is a
[keybinding signal][BindingSignal
]
which gets emitted to popdown the combo box list.
The default bindings for this signal are Alt+Up and Escape.
fn emit_popdown(&self) -> bool
fn connect_popup<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
The ::popup signal is a
[keybinding signal][BindingSignal
]
which gets emitted to popup the combo box list.
The default binding for this signal is Alt+Down.
fn emit_popup(&self)
fn connect_property_active_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
&self,
f: F
) -> SignalHandlerId
fn connect_property_active_id_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
&self,
f: F
) -> SignalHandlerId
fn connect_property_button_sensitivity_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
&self,
f: F
) -> SignalHandlerId
fn connect_property_column_span_column_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
&self,
f: F
) -> SignalHandlerId
fn connect_property_entry_text_column_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
&self,
f: F
) -> SignalHandlerId
fn connect_property_has_frame_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
&self,
f: F
) -> SignalHandlerId
fn connect_property_id_column_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
&self,
f: F
) -> SignalHandlerId
fn connect_property_model_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
&self,
f: F
) -> SignalHandlerId
fn connect_property_popup_fixed_width_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
&self,
f: F
) -> SignalHandlerId
fn connect_property_popup_shown_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
&self,
f: F
) -> SignalHandlerId
fn connect_property_row_span_column_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
&self,
f: F
) -> SignalHandlerId
fn connect_property_wrap_width_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
&self,
f: F
) -> SignalHandlerId
Implementors
impl<O: IsA<ComboBox>> ComboBoxExt for O
[src]
fn get_active_id(&self) -> Option<GString>
[src]
fn get_active_iter(&self) -> Option<TreeIter>
[src]
fn get_button_sensitivity(&self) -> SensitivityType
[src]
fn get_column_span_column(&self) -> i32
[src]
fn get_entry_text_column(&self) -> i32
[src]
fn get_focus_on_click(&self) -> bool
[src]
fn get_has_entry(&self) -> bool
[src]
fn get_id_column(&self) -> i32
[src]
fn get_model(&self) -> Option<TreeModel>
[src]
fn get_popup_accessible(&self) -> Option<Object>
[src]
fn get_popup_fixed_width(&self) -> bool
[src]
fn get_row_span_column(&self) -> i32
[src]
fn get_wrap_width(&self) -> i32
[src]
fn popdown(&self)
[src]
fn popup(&self)
[src]
fn popup_for_device(&self, device: &Device)
[src]
fn set_active_id(&self, active_id: Option<&str>) -> bool
[src]
fn set_active_iter(&self, iter: Option<&TreeIter>)
[src]
fn set_button_sensitivity(&self, sensitivity: SensitivityType)
[src]
fn set_column_span_column(&self, column_span: i32)
[src]
fn set_entry_text_column(&self, text_column: i32)
[src]
fn set_focus_on_click(&self, focus_on_click: bool)
[src]
fn set_id_column(&self, id_column: i32)
[src]
fn set_model<P: IsA<TreeModel>>(&self, model: Option<&P>)
[src]
fn set_popup_fixed_width(&self, fixed: bool)
[src]
fn set_row_separator_func<P: Fn(&TreeModel, &TreeIter) -> bool + 'static>(
&self,
func: P
)
[src]
&self,
func: P
)
fn set_row_span_column(&self, row_span: i32)
[src]
fn set_wrap_width(&self, width: i32)
[src]
fn get_property_cell_area(&self) -> Option<CellArea>
[src]
fn get_property_has_frame(&self) -> bool
[src]
fn set_property_has_frame(&self, has_frame: bool)
[src]
fn get_property_popup_shown(&self) -> bool
[src]
fn connect_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
[src]
fn connect_format_entry_text<F: Fn(&Self, &str) -> String + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
&self,
f: F
) -> SignalHandlerId
fn connect_move_active<F: Fn(&Self, ScrollType) + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
&self,
f: F
) -> SignalHandlerId
fn emit_move_active(&self, scroll_type: ScrollType)
[src]
fn connect_popdown<F: Fn(&Self) -> bool + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
&self,
f: F
) -> SignalHandlerId
fn emit_popdown(&self) -> bool
[src]
fn connect_popup<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
[src]
fn emit_popup(&self)
[src]
fn connect_property_active_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
&self,
f: F
) -> SignalHandlerId
fn connect_property_active_id_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
&self,
f: F
) -> SignalHandlerId
fn connect_property_button_sensitivity_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
&self,
f: F
) -> SignalHandlerId
fn connect_property_column_span_column_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
&self,
f: F
) -> SignalHandlerId
fn connect_property_entry_text_column_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
&self,
f: F
) -> SignalHandlerId
fn connect_property_has_frame_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
&self,
f: F
) -> SignalHandlerId
fn connect_property_id_column_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
&self,
f: F
) -> SignalHandlerId
fn connect_property_model_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
&self,
f: F
) -> SignalHandlerId
fn connect_property_popup_fixed_width_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
&self,
f: F
) -> SignalHandlerId
fn connect_property_popup_shown_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
&self,
f: F
) -> SignalHandlerId
fn connect_property_row_span_column_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
&self,
f: F
) -> SignalHandlerId
fn connect_property_wrap_width_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
&self,
f: F
) -> SignalHandlerId