gi-gtk-4.0.9: Gtk bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Gtk.Objects.ComboBoxText

Description

A GtkComboBoxText is a simple variant of GtkComboBox for text-only use cases.

GtkComboBoxText hides the model-view complexity of GtkComboBox.

To create a GtkComboBoxText, use comboBoxTextNew or comboBoxTextNewWithEntry.

You can add items to a GtkComboBoxText with comboBoxTextAppendText, comboBoxTextInsertText or comboBoxTextPrependText and remove options with comboBoxTextRemove.

If the GtkComboBoxText contains an entry (via the ComboBox:hasEntry property), its contents can be retrieved using comboBoxTextGetActiveText.

You should not call comboBoxSetModel or attempt to pack more cells into this combo box via its CellLayout interface.

GtkComboBoxText as GtkBuildable

The GtkComboBoxText implementation of the GtkBuildable interface supports adding items directly using the <items> element and specifying <item> elements for each item. Each <item> element can specify the “id” corresponding to the appended text and also supports the regular translation attributes “translatable”, “context” and “comments”.

Here is a UI definition fragment specifying GtkComboBoxText items:

xml code

<object class="GtkComboBoxText">
  <items>
    <item translatable="yes" id="factory">Factory</item>
    <item translatable="yes" id="home">Home</item>
    <item translatable="yes" id="subway">Subway</item>
  </items>
</object>

CSS nodes

combobox
╰── box.linked
    ├── entry.combo
    ├── button.combo
    ╰── window.popup

GtkComboBoxText has a single CSS node with name combobox. It adds the style class .combo to the main CSS nodes of its entry and button children, and the .linked class to the node of its internal box.

Synopsis

Exported types

newtype ComboBoxText Source #

Memory-managed wrapper type.

Constructors

ComboBoxText (ManagedPtr ComboBoxText) 

Instances

Instances details
Eq ComboBoxText Source # 
Instance details

Defined in GI.Gtk.Objects.ComboBoxText

GObject ComboBoxText Source # 
Instance details

Defined in GI.Gtk.Objects.ComboBoxText

ManagedPtrNewtype ComboBoxText Source # 
Instance details

Defined in GI.Gtk.Objects.ComboBoxText

Methods

toManagedPtr :: ComboBoxText -> ManagedPtr ComboBoxText

TypedObject ComboBoxText Source # 
Instance details

Defined in GI.Gtk.Objects.ComboBoxText

Methods

glibType :: IO GType

HasParentTypes ComboBoxText Source # 
Instance details

Defined in GI.Gtk.Objects.ComboBoxText

IsGValue (Maybe ComboBoxText) Source #

Convert ComboBoxText to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Objects.ComboBoxText

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe ComboBoxText -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe ComboBoxText)

type ParentTypes ComboBoxText Source # 
Instance details

Defined in GI.Gtk.Objects.ComboBoxText

class (GObject o, IsDescendantOf ComboBoxText o) => IsComboBoxText o Source #

Type class for types which can be safely cast to ComboBoxText, for instance with toComboBoxText.

Instances

Instances details
(GObject o, IsDescendantOf ComboBoxText o) => IsComboBoxText o Source # 
Instance details

Defined in GI.Gtk.Objects.ComboBoxText

toComboBoxText :: (MonadIO m, IsComboBoxText o) => o -> m ComboBoxText Source #

Cast to ComboBoxText, for types for which this is known to be safe. For general casts, use castTo.

Methods

Click to display all available methods, including inherited ones

Expand

Methods

actionSetEnabled, activate, activateAction, activateDefault, addAttribute, addController, addCssClass, addMnemonicLabel, addTickCallback, allocate, announce, append, appendText, bindProperty, bindPropertyFull, childFocus, clear, clearAttributes, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, disposeTemplate, dragCheckThreshold, editingDone, errorBell, forceFloating, freezeNotify, getv, grabFocus, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insert, insertActionGroup, insertAfter, insertBefore, insertText, isAncestor, isDrawable, isFloating, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, notify, notifyByPspec, observeChildren, observeControllers, packEnd, packStart, pick, popdown, popup, popupForDevice, prepend, prependText, queueAllocate, queueDraw, queueResize, realize, ref, refSink, remove, removeAll, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, removeWidget, reorder, resetProperty, resetRelation, resetState, runDispose, shouldLayout, show, sizeAllocate, snapshotChild, startEditing, stealData, stealQdata, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unsetStateFlags, updateNextAccessibleSibling, updateProperty, updateRelation, updateState, watchClosure.

Getters

getAccessibleParent, getAccessibleRole, getActive, getActiveId, getActiveIter, getActiveText, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getArea, getAtContext, getBaseline, getBounds, getBuildableId, getButtonSensitivity, getCanFocus, getCanTarget, getCells, getChild, getChildVisible, getClipboard, getColor, getCssClasses, getCssName, getCursor, getData, getDirection, getDisplay, getEntryTextColumn, getFirstAccessibleChild, getFirstChild, getFocusChild, getFocusOnClick, getFocusable, getFontMap, getFontOptions, getFrameClock, getHalign, getHasEntry, getHasTooltip, getHeight, getHexpand, getHexpandSet, getIdColumn, getLastChild, getLayoutManager, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getModel, getName, getNative, getNextAccessibleSibling, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPlatformState, getPopupFixedWidth, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth.

Setters

setAccessibleParent, setActive, setActiveId, setActiveIter, setButtonSensitivity, setCanFocus, setCanTarget, setCellDataFunc, setChild, setChildVisible, setCssClasses, setCursor, setCursorFromName, setData, setDataFull, setDirection, setEntryTextColumn, setFocusChild, setFocusOnClick, setFocusable, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setIdColumn, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setModel, setName, setOpacity, setOverflow, setParent, setPopupFixedWidth, setProperty, setReceivesDefault, setRowSeparatorFunc, setSensitive, setSizeRequest, setStateFlags, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible.

append

comboBoxTextAppend Source #

Arguments

:: (HasCallStack, MonadIO m, IsComboBoxText a) 
=> a

comboBox: A GtkComboBoxText

-> Maybe Text

id: a string ID for this value

-> Text

text: A string

-> m () 

Deprecated: (Since version 4.10)Use DropDown

Appends text to the list of strings stored in comboBox.

If id is non-Nothing then it is used as the ID of the row.

This is the same as calling comboBoxTextInsert with a position of -1.

appendText

comboBoxTextAppendText Source #

Arguments

:: (HasCallStack, MonadIO m, IsComboBoxText a) 
=> a

comboBox: A GtkComboBoxText

-> Text

text: A string

-> m () 

Deprecated: (Since version 4.10)Use DropDown

Appends text to the list of strings stored in comboBox.

This is the same as calling comboBoxTextInsertText with a position of -1.

getActiveText

comboBoxTextGetActiveText Source #

Arguments

:: (HasCallStack, MonadIO m, IsComboBoxText a) 
=> a

comboBox: A GtkComboBoxText

-> m (Maybe Text)

Returns: a newly allocated string containing the currently active text. Must be freed with free.

Deprecated: (Since version 4.10)Use DropDown

Returns the currently active string in comboBox.

If no row is currently selected, Nothing is returned. If comboBox contains an entry, this function will return its contents (which will not necessarily be an item from the list).

insert

comboBoxTextInsert Source #

Arguments

:: (HasCallStack, MonadIO m, IsComboBoxText a) 
=> a

comboBox: A GtkComboBoxText

-> Int32

position: An index to insert text

-> Maybe Text

id: a string ID for this value

-> Text

text: A string to display

-> m () 

Deprecated: (Since version 4.10)Use DropDown

Inserts text at position in the list of strings stored in comboBox.

If id is non-Nothing then it is used as the ID of the row. See ComboBox:idColumn.

If position is negative then text is appended.

insertText

comboBoxTextInsertText Source #

Arguments

:: (HasCallStack, MonadIO m, IsComboBoxText a) 
=> a

comboBox: A GtkComboBoxText

-> Int32

position: An index to insert text

-> Text

text: A string

-> m () 

Deprecated: (Since version 4.10)Use DropDown

Inserts text at position in the list of strings stored in comboBox.

If position is negative then text is appended.

This is the same as calling comboBoxTextInsert with a Nothing ID string.

new

comboBoxTextNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m ComboBoxText

Returns: A new GtkComboBoxText

Deprecated: (Since version 4.10)Use DropDown

Creates a new GtkComboBoxText.

newWithEntry

comboBoxTextNewWithEntry Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m ComboBoxText

Returns: a new GtkComboBoxText

Deprecated: (Since version 4.10)Use DropDown

Creates a new GtkComboBoxText with an entry.

prepend

comboBoxTextPrepend Source #

Arguments

:: (HasCallStack, MonadIO m, IsComboBoxText a) 
=> a

comboBox: A GtkComboBox

-> Maybe Text

id: a string ID for this value

-> Text

text: a string

-> m () 

Deprecated: (Since version 4.10)Use DropDown

Prepends text to the list of strings stored in comboBox.

If id is non-Nothing then it is used as the ID of the row.

This is the same as calling comboBoxTextInsert with a position of 0.

prependText

comboBoxTextPrependText Source #

Arguments

:: (HasCallStack, MonadIO m, IsComboBoxText a) 
=> a

comboBox: A GtkComboBox

-> Text

text: A string

-> m () 

Deprecated: (Since version 4.10)Use DropDown

Prepends text to the list of strings stored in comboBox.

This is the same as calling comboBoxTextInsertText with a position of 0.

remove

comboBoxTextRemove Source #

Arguments

:: (HasCallStack, MonadIO m, IsComboBoxText a) 
=> a

comboBox: A GtkComboBox

-> Int32

position: Index of the item to remove

-> m () 

Deprecated: (Since version 4.10)Use DropDown

Removes the string at position from comboBox.

removeAll

comboBoxTextRemoveAll Source #

Arguments

:: (HasCallStack, MonadIO m, IsComboBoxText a) 
=> a

comboBox: A GtkComboBoxText

-> m () 

Deprecated: (Since version 4.10)Use DropDown

Removes all the text entries from the combo box.