Skip to main content

Type Alias: GtkEntryProps

GtkEntryProps = WidgetProps & object

Defined in: generated/jsx.ts:3493

Props for the GtkEntry widget.

Type Declaration

NameTypeDescriptionDefined in
activatesDefault?booleanWhether to activate the default widget when Enter is pressed.generated/jsx.ts:3495
attributes?Pango.AttrList | nullA list of Pango attributes to apply to the text of the entry. This is mainly useful to change the size or weight of the text. The PangoAttribute's start_index and end_index must refer to the EntryBuffer text, i.e. without the preedit string.generated/jsx.ts:3504
buffer?Gtk.EntryBufferThe buffer object which actually stores the text.generated/jsx.ts:3506
completion?Gtk.EntryCompletion | nullThe auxiliary completion object to use with the entry.generated/jsx.ts:3508
editable?booleanWhether the entry contents can be edited.generated/jsx.ts:3694
editingCanceled?booleanIndicates whether editing on the cell has been canceled.generated/jsx.ts:3692
enableEmojiCompletion?booleanWhether to suggest Emoji replacements for :-delimited names like :heart:.generated/jsx.ts:3513
enableUndo?booleanIf undo/redo should be enabled for the editable.generated/jsx.ts:3696
extraMenu?Gio.MenuModel | nullA menu model whose contents will be appended to the context menu.generated/jsx.ts:3515
hasFrame?booleanWhether the entry should draw a frame.generated/jsx.ts:3517
imModule?stringWhich IM (input method) module should be used for this entry. See IMContext. Setting this to a non-%NULL value overrides the system-wide IM module setting. See the GtkSettings Settings.gtk-im-module property.generated/jsx.ts:3527
inputHints?Gtk.InputHintsAdditional hints that allow input methods to fine-tune their behavior. Also see Entry.input-purposegenerated/jsx.ts:3533
inputPurpose?Gtk.InputPurposeThe purpose of this text field. This property can be used by on-screen keyboards and other input methods to adjust their behaviour. Note that setting the purpose to %GTK_INPUT_PURPOSE_PASSWORD or %GTK_INPUT_PURPOSE_PIN is independent from setting Entry.visibility.generated/jsx.ts:3544
invisibleChar?numberThe character to use when masking entry contents (“password mode”).generated/jsx.ts:3546
invisibleCharSet?booleanWhether the invisible char has been set for the GtkEntry.generated/jsx.ts:3548
maxLength?numberMaximum number of characters for this entry.generated/jsx.ts:3550
maxWidthChars?numberThe desired maximum width of the entry, in characters.generated/jsx.ts:3698
menuEntryIconPrimaryText?stringText for an item in the context menu to activate the primary icon action. When the primary icon is activatable and this property has been set, a new entry in the context menu of this GtkEntry will appear with this text. Selecting that menu entry will result in the primary icon being activated, exactly in the same way as it would be activated from a mouse click. This simplifies adding accessibility support to applications using activatable icons. The activatable icons aren't focusable when navigating the interface with the keyboard This is why Gtk recommends to also add those actions in the context menu. This set of methods greatly simplifies this, by adding a menu item that, when enabled, calls the same callback than clicking on the icon.generated/jsx.ts:3565
menuEntryIconSecondaryText?stringText for an item in the context menu to activate the secondary icon action. When the primary icon is activatable and this property has been set, a new entry in the context menu of this GtkEntry will appear with this text. Selecting that menu entry will result in the primary icon being activated, exactly in the same way as it would be activated from a mouse click. This simplifies adding accessibility support to applications using activatable icons. The activatable icons aren't focusable when navigating the interface with the keyboard This is why Gtk recommends to also add those actions in the context menu. This set of methods greatly simplifies this, by adding a menu item that, when enabled, calls the same callback than clicking on the icon.generated/jsx.ts:3580
onActivate()?(self) => void | nullEmitted when the entry is activated. The keybindings for this signal are all forms of the Enter key.generated/jsx.ts:3714
onChanged()?(self) => void | nullEmitted at the end of a single user-visible operation on the contents. E.g., a paste operation that replaces the contents of the selection will cause only one signal emission (even though it is implemented by first deleting the selection, then inserting the new content, and may cause multiple ::notify::text signals to be emitted).generated/jsx.ts:3761
onDeleteText()?(self, startPos, endPos) => void | nullEmitted when text is deleted from the widget by the user. The default handler for this signal will normally be responsible for deleting the text, so by connecting to this signal and then stopping the signal with g_signal_stop_emission(), it is possible to modify the range of deleted text, or prevent it from being deleted entirely. The start_pos and end_pos parameters are interpreted as for Editable.delete_text.generated/jsx.ts:3773
onEditingDone()?(self) => void | nullThis signal is a sign for the cell renderer to update its value from the cell_editable. Implementations of GtkCellEditable are responsible for emitting this signal when they are done editing, e.g. GtkEntry emits this signal when the user presses Enter. Typical things to do in a handler for ::editing-done are to capture the edited value, disconnect the cell_editable from signals on the GtkCellRenderer, etc. gtk_cell_editable_editing_done() is a convenience method for emitting GtkCellEditable::editing-done.generated/jsx.ts:3735
onIconPress()?(self, iconPos) => void | nullEmitted when an activatable icon is clicked.generated/jsx.ts:3716
onIconRelease()?(self, iconPos) => void | nullEmitted on the button release from a mouse click over an activatable icon.generated/jsx.ts:3721
onInsertText()?(self, text, length, position) => void | nullEmitted when text is inserted into the widget by the user. The default handler for this signal will normally be responsible for inserting the text, so by connecting to this signal and then stopping the signal with g_signal_stop_emission(), it is possible to modify the inserted text, or prevent it from being inserted entirely.generated/jsx.ts:3782
onNotify?(self, propName) => void | nullCalled when any property on this widget changes. Param The widget that emitted the notification Param The name of the property that changed (in kebab-case)generated/jsx.ts:3788
onRemoveWidget()?(self) => void | nullThis signal is meant to indicate that the cell is finished editing, and the cell_editable widget is being removed and may subsequently be destroyed. Implementations of GtkCellEditable are responsible for emitting this signal when they are done editing. It must be emitted after the GtkCellEditable::editing-done signal, to give the cell renderer a chance to update the cell's value before the widget is removed. gtk_cell_editable_remove_widget() is a convenience method for emitting GtkCellEditable::remove-widget.generated/jsx.ts:3750
overwriteMode?booleanIf text is overwritten when typing in the GtkEntry.generated/jsx.ts:3582
placeholderText?string | nullThe text that will be displayed in the GtkEntry when it is empty and unfocused.generated/jsx.ts:3587
primaryIconActivatable?booleanWhether the primary icon is activatable. GTK emits the Entry.:icon-press and Entry.:icon-release signals only on sensitive, activatable icons. Sensitive, but non-activatable icons can be used for purely informational purposes.generated/jsx.ts:3598
primaryIconGicon?Gio.IconThe GIcon to use for the primary icon for the entry.generated/jsx.ts:3600
primaryIconName?stringThe icon name to use for the primary icon for the entry.generated/jsx.ts:3602
primaryIconPaintable?Gdk.PaintableA GdkPaintable to use as the primary icon for the entry.generated/jsx.ts:3604
primaryIconSensitive?booleanWhether the primary icon is sensitive. An insensitive icon appears grayed out. GTK does not emit the Entry.:icon-press and Entry.:icon-release signals and does not allow DND from insensitive icons. An icon should be set insensitive if the action that would trigger when clicked is currently not available.generated/jsx.ts:3615
primaryIconTooltipMarkup?stringThe contents of the tooltip on the primary icon, with markup. Also see Entry.set_icon_tooltip_markup.generated/jsx.ts:3621
primaryIconTooltipText?stringThe contents of the tooltip on the primary icon. Also see Entry.set_icon_tooltip_text.generated/jsx.ts:3627
progressFraction?numberThe current fraction of the task that's been completed.generated/jsx.ts:3629
progressPulseStep?numberThe fraction of total entry width to move the progress bouncing block for each pulse. See Entry.progress_pulse.generated/jsx.ts:3636
ref?Ref<Gtk.Entry>-generated/jsx.ts:3838
secondaryIconActivatable?booleanWhether the secondary icon is activatable. GTK emits the Entry.:icon-press and Entry.:icon-release signals only on sensitive, activatable icons. Sensitive, but non-activatable icons can be used for purely informational purposes.generated/jsx.ts:3647
secondaryIconGicon?Gio.IconThe GIcon to use for the secondary icon for the entry.generated/jsx.ts:3649
secondaryIconName?stringThe icon name to use for the secondary icon for the entry.generated/jsx.ts:3651
secondaryIconPaintable?Gdk.PaintableA GdkPaintable to use as the secondary icon for the entry.generated/jsx.ts:3653
secondaryIconSensitive?booleanWhether the secondary icon is sensitive. An insensitive icon appears grayed out. GTK does not emit the Entry.:icon-press[ and [signal`Gtk`.Entryicon-release signals and does not allow DND from insensitive icons. An icon should be set insensitive if the action that would trigger when clicked is currently not available.generated/jsx.ts:3664
secondaryIconTooltipMarkup?stringThe contents of the tooltip on the secondary icon, with markup. Also see Entry.set_icon_tooltip_markup.generated/jsx.ts:3670
secondaryIconTooltipText?stringThe contents of the tooltip on the secondary icon. Also see Entry.set_icon_tooltip_text.generated/jsx.ts:3676
showEmojiIcon?booleanWhether the entry will show an Emoji icon in the secondary icon position to open the Emoji chooser.generated/jsx.ts:3681
tabs?Pango.TabArray | nullA list of tabstops to apply to the text of the entry.generated/jsx.ts:3683
text?stringThe contents of the entry.generated/jsx.ts:3700
truncateMultiline?booleanWhen %TRUE, pasted multi-line text is truncated to the first line.generated/jsx.ts:3685
visibility?booleanWhether the entry should show the “invisible char” instead of the actual text (“password mode”).generated/jsx.ts:3690
widthChars?numberNumber of characters to leave space for in the entry.generated/jsx.ts:3702
xalign?numberThe horizontal alignment, from 0 (left) to 1 (right). Reversed for RTL layouts.generated/jsx.ts:3708