Skip to main content

Type Alias: GtkEntryProps

GtkEntryProps = WidgetProps & object

Defined in: generated/jsx.ts:2849

Props for the GtkEntry widget.

Type Declaration

NameTypeDescriptionDefined in
activatesDefault?booleanWhether to activate the default widget when Enter is pressed.generated/jsx.ts:2851
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:2860
buffer?Gtk.EntryBufferThe buffer object which actually stores the text.generated/jsx.ts:2862
children?ReactNode-generated/jsx.ts:3139
completion?Gtk.EntryCompletion | nullThe auxiliary completion object to use with the entry.generated/jsx.ts:2864
editable?booleanWhether the entry contents can be edited.generated/jsx.ts:3050
editingCanceled?booleanIndicates whether editing on the cell has been canceled.generated/jsx.ts:3048
enableEmojiCompletion?booleanWhether to suggest Emoji replacements for :-delimited names like :heart:.generated/jsx.ts:2869
enableUndo?booleanIf undo/redo should be enabled for the editable.generated/jsx.ts:3052
extraMenu?Gio.MenuModel | nullA menu model whose contents will be appended to the context menu.generated/jsx.ts:2871
hasFrame?booleanWhether the entry should draw a frame.generated/jsx.ts:2873
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:2883
inputHints?Gtk.InputHintsAdditional hints that allow input methods to fine-tune their behavior. Also see Entry.input-purposegenerated/jsx.ts:2889
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:2900
invisibleChar?numberThe character to use when masking entry contents (“password mode”).generated/jsx.ts:2902
invisibleCharSet?booleanWhether the invisible char has been set for the GtkEntry.generated/jsx.ts:2904
maxLength?numberMaximum number of characters for this entry.generated/jsx.ts:2906
maxWidthChars?numberThe desired maximum width of the entry, in characters.generated/jsx.ts:3054
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:2921
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:2936
onActivate?(self) => void | nullEmitted when the entry is activated. The keybindings for this signal are all forms of the Enter key.generated/jsx.ts:3070
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:3117
onDeleteText?(startPos, endPos, self) => 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:3129
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:3091
onIconPress?(iconPos, self) => void | nullEmitted when an activatable icon is clicked.generated/jsx.ts:3072
onIconRelease?(iconPos, self) => void | nullEmitted on the button release from a mouse click over an activatable icon.generated/jsx.ts:3077
onInsertText?(text, length, position, self) => 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:3138
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:3106
overwriteMode?booleanIf text is overwritten when typing in the GtkEntry.generated/jsx.ts:2938
placeholderText?string | nullThe text that will be displayed in the GtkEntry when it is empty and unfocused.generated/jsx.ts:2943
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:2954
primaryIconGicon?Gio.IconThe GIcon to use for the primary icon for the entry.generated/jsx.ts:2956
primaryIconName?stringThe icon name to use for the primary icon for the entry.generated/jsx.ts:2958
primaryIconPaintable?Gdk.PaintableA GdkPaintable to use as the primary icon for the entry.generated/jsx.ts:2960
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:2971
primaryIconTooltipMarkup?stringThe contents of the tooltip on the primary icon, with markup. Also see Entry.set_icon_tooltip_markup.generated/jsx.ts:2977
primaryIconTooltipText?stringThe contents of the tooltip on the primary icon. Also see Entry.set_icon_tooltip_text.generated/jsx.ts:2983
progressFraction?numberThe current fraction of the task that's been completed.generated/jsx.ts:2985
progressPulseStep?numberThe fraction of total entry width to move the progress bouncing block for each pulse. See Entry.progress_pulse.generated/jsx.ts:2992
ref?Ref<Gtk.Entry>-generated/jsx.ts:3140
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:3003
secondaryIconGicon?Gio.IconThe GIcon to use for the secondary icon for the entry.generated/jsx.ts:3005
secondaryIconName?stringThe icon name to use for the secondary icon for the entry.generated/jsx.ts:3007
secondaryIconPaintable?Gdk.PaintableA GdkPaintable to use as the secondary icon for the entry.generated/jsx.ts:3009
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:3020
secondaryIconTooltipMarkup?stringThe contents of the tooltip on the secondary icon, with markup. Also see Entry.set_icon_tooltip_markup.generated/jsx.ts:3026
secondaryIconTooltipText?stringThe contents of the tooltip on the secondary icon. Also see Entry.set_icon_tooltip_text.generated/jsx.ts:3032
showEmojiIcon?booleanWhether the entry will show an Emoji icon in the secondary icon position to open the Emoji chooser.generated/jsx.ts:3037
tabs?Pango.TabArray | nullA list of tabstops to apply to the text of the entry.generated/jsx.ts:3039
text?stringThe contents of the entry.generated/jsx.ts:3056
truncateMultiline?booleanWhen %TRUE, pasted multi-line text is truncated to the first line.generated/jsx.ts:3041
visibility?booleanWhether the entry should show the “invisible char” instead of the actual text (“password mode”).generated/jsx.ts:3046
widthChars?numberNumber of characters to leave space for in the entry.generated/jsx.ts:3058
xalign?numberThe horizontal alignment, from 0 (left) to 1 (right). Reversed for RTL layouts.generated/jsx.ts:3064