Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: EntryBufferMeta

[491:14] static extends: object

Generated metadata helpers for EntryBuffer class surfaces.

Methods

  • properties ()

    Returns property metadata for EntryBuffer.

    • @r A list.
  • signals ()

    Returns signal metadata for EntryBuffer.

    • @r A list.

class: EntryBuffer

[18:7] extends: object

Holds the text that is displayed in a single-line text entry widget. A single GtkEntryBuffer object can be shared by multiple widgets which will then share the same text content, but not the cursor position, visibility attributes, icon etc. GtkEntryBuffer may be derived from. Such a derived class might allow text to be stored in an alternate location, such as non-pageable memory, useful in the case of important passwords. Or a derived class could integrate with an application’s concept of undo/redo.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • EntryBuffer (initial_chars = null, n_initial_chars = null)

    Create a new GtkEntryBuffer object. Optionally, specify initial text to set in the buffer.

    • @p initial_chars is initial buffer text.
    • @p n_initial_chars is number of characters in @initial_chars, or -1.
  • 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 exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • asObject ()

    Wraps this handle as Object.

    • @r A Object object.
  • connectSignal (string Name, CallbackObj)

    Connects one generated callback wrapper to a named signal.

    • @p Name is the signal name.
    • @p CallbackObj is the generated callback wrapper to connect.
    • @r The connected handler id.
  • disconnectSignalHandler (int HandlerId)

    Disconnects one retained signal handler id.

    • @p HandlerId is the signal handler id to disconnect.
    • @r None.
  • setOnDeletedtext (callback Fn, UserData = null)

    The text is altered in the default handler for this signal. If you want access to the text after the text has been modified, use %G_CONNECT_AFTER.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (EntryBuffer Self, int Position, int N_chars).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnInsertedtext (callback Fn, UserData = null)

    This signal is emitted after text is inserted into the buffer.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (EntryBuffer Self, int Position, string Chars, int N_chars).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • getProperty (string Name)

    Reads one generated property by name.

  • setProperty (string Name, Value)

    Writes one generated property by name.

  • setMaxlength (int Value)

    The maximum length (in characters) of the text in the buffer.

    • @p Value is the new property value.
    • @r None.
  • setText (string Value)

    The contents of the buffer.

    • @p Value is the new property value.
    • @r None.
  • delete_text (int position, int n_chars)

    Deletes a sequence of characters from the buffer. @n_chars characters are deleted starting at @position. If @n_chars is negative, then all characters until the end of the text are deleted. If @position or

    • @n_chars are out of bounds, then they are coerced to sane values. Note that the positions are specified in characters, not bytes.
    • @p position is position at which to delete text.
    • @p n_chars is number of characters to delete.
  • emit_deleted_text (int position, int n_chars)

    Used when subclassing GtkEntryBuffer.

    • @p position is position at which text was deleted.
    • @p n_chars is number of characters deleted.
    • @r None.
  • emit_inserted_text (int position, string chars, int n_chars)

    Used when subclassing GtkEntryBuffer.

    • @p position is position at which text was inserted.
    • @p chars is text that was inserted.
    • @p n_chars is number of characters inserted.
    • @r None.
  • get_bytes ()

    Retrieves the length in bytes of the buffer. See [method@Gtk.EntryBuffer.get_length].

  • get_length ()

    Retrieves the length in characters of the buffer.

  • get_max_length ()

    Retrieves the maximum allowed length of the text in @buffer.

  • get_text ()

    Retrieves the contents of the buffer. The memory pointer returned by this call will not change unless this object emits a signal, or is finalized.

  • insert_text (int position, string chars, int n_chars)

    Inserts @n_chars characters of @chars into the contents of the buffer, at position @position. If @n_chars is negative, then characters from chars will be inserted until a null-terminator is found. If @position or

    • @n_chars are out of bounds, or the maximum buffer text length is exceeded, then they are coerced to sane values. Note that the position and length are in characters, not in bytes.
    • @p position is the position at which to insert text..
    • @p chars is the text to insert into the buffer..
    • @p n_chars is the length of the text in characters, or -1.
  • set_max_length (int max_length)

    Sets the maximum allowed length of the contents of the buffer. If the current contents are longer than the given length, then they will be truncated to fit.

    • @p max_length is the maximum length of the entry buffer, or 0 for no maximum. (other than the maximum length of entries.) The value passed in will be clamped to the range 0-65536..
    • @r None.
  • set_text (string chars, int n_chars)

    Sets the text in the buffer. This is roughly equivalent to calling [method@Gtk.EntryBuffer.delete_text] and [method@Gtk.EntryBuffer.insert_text]. Note that @n_chars is in characters, not in bytes.

    • @p chars is the new text.
    • @p n_chars is the number of characters in @text, or -1.
    • @r None.

class: EntryBufferInsertedtextCallback

[421:7] extends: object

Generated low-level callback wrapper for GIR callback inserted-text.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • EntryBufferInsertedtextCallback (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.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, position, chars, n_chars, 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.

class: EntryBufferDeletedtextCallback

[351:7] extends: object

Generated low-level callback wrapper for GIR callback deleted-text.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • EntryBufferDeletedtextCallback (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.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, position, n_chars, 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.