[670:14] static extends: object
Generated metadata helpers for DropDown class surfaces.
properties ()
Returns property metadata for
DropDown.
A list.signals ()
Returns signal metadata for
DropDown.
A list.[600:7] extends: object
Generated low-level callback wrapper for GIR callback activate.
DropDownActivateCallback (callback Fn, UserData = null)
Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking
Fn.
Fn is the Aussom callback implementation.UserData is retained and passed through to Fn on each invocation when provided.trampoline (nativeSelf, nativeUserData)
Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.
callback ()
Returns the wrapped NativeCallback.
handle ()
Returns the callback as a NativeHandle.
close ()
Closes the underlying NativeCallback.
isClosed ()
Returns true when the callback has been closed.
[40:7] extends: object
Allows the user to choose an item from a list of options.
GtkDropDown displays the [selected][property@Gtk.DropDown:selected] choice.
The options are given to GtkDropDown in the form of GListModel and how
the individual options are represented is determined by a
[class@Gtk.ListItemFactory]. The default factory displays simple strings, and
adds a checkmark to the selected item in the popup. To set your own factory,
use [method@Gtk.DropDown.set_factory]. It is possible to use a separate
factory for the items in the popup, with
[method@Gtk.DropDown.set_list_factory]. GtkDropDown knows how to obtain
strings from the items in a [class@Gtk.StringList]; for other models, you
have to provide an expression to find the strings via
[method@Gtk.DropDown.set_expression]. GtkDropDown can optionally allow
search in the popup, which is useful if the list of options is long. To
enable the search entry, use [method@Gtk.DropDown.set_enable_search]. Here is
a UI definition example for GtkDropDown with a simple model: xml <object class="GtkDropDown"> <property name="model"> <object class="GtkStringList"> <items> <item translatable="yes">Factory</item> <item translatable="yes">Home</item> <item translatable="yes">Subway</item> </items> </object> </property> </object> If a GtkDropDown is created in
this manner, or with [ctor@Gtk.DropDown.new_from_strings], for instance, the
object returned from [method@Gtk.DropDown.get_selected_item] will be a
[class@Gtk.StringObject]. To learn more about the list widget framework, see
the overview. ## CSS nodes GtkDropDown has a
single CSS node with name dropdown, with the button and popover nodes as
children. ## Accessibility GtkDropDown uses the
[enum@Gtk.AccessibleRole.combo_box] role.
DropDown (model = null, expression = null)
Creates a new
GtkDropDown. You may want to call [method@Gtk.DropDown.set_factory] to set up a way to map its items to widgets.
model is the model to use.expression is the expression to use.toNativeHandle (Source)
Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from
fn.call(...), another generated wrapper exposinghandle(), or null. Returns null when the argument carries no pointer.
Source is the raw handle, raw buffer, wrapper, or null.A raw pointer carrier or null when no pointer is present.getLib ()
Returns the opened native library for this generated wrapper.
The opened native library.handle ()
Returns the wrapped NativeHandle.
The wrapped NativeHandle.isNull ()
Returns true when the wrapped handle is null.
A bool.describe ()
Returns a small string for debugging generated wrappers.
A string.asWidget ()
Wraps this handle as
Widget.
A Widget object.asAccessible ()
Wraps this handle as
Accessible.
A Accessible object.asBuildable ()
Wraps this handle as
Buildable.
A Buildable object.asConstraintTarget ()
Wraps this handle as
ConstraintTarget.
A ConstraintTarget object.connectSignal (string Name, CallbackObj)
Connects one generated callback wrapper to a named signal.
Name is the signal name.CallbackObj is the generated callback wrapper to connect.The connected handler id.disconnectSignalHandler (int HandlerId)
Disconnects one retained signal handler id.
HandlerId is the signal handler id to disconnect.None.setOnActivate (callback Fn, UserData = null)
Emitted to when the drop down is activated. The
::activatesignal onGtkDropDownis an action signal and emitting it causes the drop down to pop up its dropdown.
Fn is the Aussom callback.Fn is called with (DropDown Self).UserData is retained and passed through to the generated callback wrapper when provided.The connected handler id.getProperty (string Name)
Reads one generated property by name.
setProperty (string Name, Value)
Writes one generated property by name.
setEnablesearch (bool Value)
Whether to show a search entry in the popup. Note that search requires [property@Gtk.DropDown:expression] to be set.
Value is the new property value.None.setExpression (object Value)
An expression to evaluate to obtain strings to match against the search term. See [property@Gtk.DropDown:enable-search] for how to enable search. If [property@Gtk.DropDown:factory] is not set, the expression is also used to bind strings to labels produced by a default factory.
Value is the new property value.None.setFactory (object Value)
Factory for populating list items.
Value is the new property value.None.setHeaderfactory (object Value)
The factory for creating header widgets for the popup.
Value is the new property value.None.setListfactory (object Value)
The factory for populating list items in the popup. If this is not set, [property@Gtk.DropDown:factory] is used.
Value is the new property value.None.setModel (object Value)
Model for the displayed items.
Value is the new property value.None.setSearchmatchmode (string Value)
The match mode for the search filter.
Value is the new property value.None.setSelected (int Value)
The position of the selected item. If no item is selected, the property has the value %GTK_INVALID_LIST_POSITION.
Value is the new property value.None.setShowarrow (bool Value)
Whether to show an arrow within the GtkDropDown widget.
Value is the new property value.None.get_enable_search ()
Returns whether search is enabled.
get_expression ()
Gets the expression set that is used to obtain strings from items. See [method@Gtk.DropDown.set_expression].
get_factory ()
Gets the factory that's currently used to populate list items. The factory returned by this function is always used for the item in the button. It is also used for items in the popup if [property@Gtk.DropDown:list-factory] is not set.
get_header_factory ()
Gets the factory that's currently used to create header widgets for the popup.
get_list_factory ()
Gets the factory that's currently used to populate list items in the popup.
get_model ()
Gets the model that provides the displayed items.
get_search_match_mode ()
Returns the match mode that the search filter is using.
get_selected ()
Gets the position of the selected item.
get_selected_item ()
Gets the selected item. If no item is selected, %NULL is returned.
get_show_arrow ()
Returns whether to show an arrow within the widget.
set_enable_search (bool enable_search)
Sets whether a search entry will be shown in the popup that allows to search for items in the list. Note that [property@Gtk.DropDown:expression] must be set for search to work.
enable_search is whether to enable search.None.set_expression (object expression)
Sets the expression that gets evaluated to obtain strings from items. This is used for search in the popup. The expression must have a value type of %G_TYPE_STRING.
expression is a GtkExpression.None.set_factory (object factory)
Sets the
GtkListItemFactoryto use for populating list items.
factory is the factory to use.None.set_header_factory (object factory)
Sets the
GtkListItemFactoryto use for creating header widgets for the popup.
factory is the factory to use.None.set_list_factory (object factory)
Sets the
GtkListItemFactoryto use for populating list items in the popup.
factory is the factory to use.None.set_model (object model)
Sets the
GListModelto use.
model is the model to use.None.set_search_match_mode (string search_match_mode)
Sets the match mode for the search filter.
search_match_mode is the new match mode.None.set_selected (int position)
Selects the item at the given position.
position is the position of the item to select, or %GTK_INVALID_LIST_POSITION.None.set_show_arrow (bool show_arrow)
Sets whether an arrow will be displayed within the widget.
show_arrow is whether to show an arrow within the widget.None.model ()
Returns
get_modelas an Aussom list of wrapper objects. This companion method materializes the full collection up front; useget_model()when lazy or change-notify access is required.
An Aussom list of elements.[581:14] static extends: object
Alternate constructors for DropDown. Usage:
DropDownCtors.<name>(...). The primary constructor lives
directly on DropDown.
newFromStrings (list strings)
Creates a new
GtkDropDownthat is populated with the strings.
strings is The strings to put in the dropdown.A new DropDown.