Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: LinkButtonMeta

[378:14] static extends: object

Generated metadata helpers for LinkButton class surfaces.

Methods

  • properties ()

    Returns property metadata for LinkButton.

    • @r A list.
  • signals ()

    Returns signal metadata for LinkButton.

    • @r A list.

class: LinkButton

[29:7] extends: object

A button with a hyperlink. An example GtkLinkButton It is useful to show quick links to resources. A link button is created by calling either [ctor@Gtk.LinkButton.new] or [ctor@Gtk.LinkButton.new_with_label]. If using the former, the URI you pass to the constructor is used as a label for the widget. The URI bound to a GtkLinkButton can be set specifically using [method@Gtk.LinkButton.set_uri]. By default, GtkLinkButton calls [method@Gtk.FileLauncher.launch] when the button is clicked. This behaviour can be overridden by connecting to the [signal@Gtk.LinkButton::activate-link] signal and returning %TRUE from the signal handler. # Shortcuts and Gestures GtkLinkButton supports the following keyboard shortcuts: - Shift+F10 or Menu opens the context menu. # Actions GtkLinkButton defines a set of built-in actions: - clipboard.copy copies the url to the clipboard. - menu.popup opens the context menu. # CSS nodes GtkLinkButton has a single CSS node with name button. To differentiate it from a plain GtkButton, it gets the .link style class. # Accessibility GtkLinkButton uses the [enum@Gtk.AccessibleRole.link] role.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • LinkButton (uri = null, label = null)

    Creates a new GtkLinkButton with the URI as its text.

    • @p uri is a valid URI.
    • @p label is the text of the button.
  • 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.
  • asButton ()

    Wraps this handle as Button.

    • @r A Button object.
  • asAccessible ()

    Wraps this handle as Accessible.

    • @r A Accessible object.
  • asActionable ()

    Wraps this handle as Actionable.

    • @r A Actionable object.
  • asBuildable ()

    Wraps this handle as Buildable.

    • @r A Buildable object.
  • asConstraintTarget ()

    Wraps this handle as ConstraintTarget.

    • @r A ConstraintTarget 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.
  • setOnActivatelink (callback Fn, UserData = null)

    Emitted each time the GtkLinkButton is clicked. The default handler will call [method@Gtk.FileLauncher.launch] with the URI stored inside the [property@Gtk.LinkButton:uri] property. To override the default behavior, you can connect to the ::activate-link signal and stop the propagation of the signal by returning %TRUE from your handler.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (LinkButton Self).
    • @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.

  • setUri (string Value)

    The URI bound to this button.

    • @p Value is the new property value.
    • @r None.
  • setVisited (bool Value)

    The 'visited' state of this button. A visited link is drawn in a different color.

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

    Retrieves the URI of the GtkLinkButton.

  • get_visited ()

    Retrieves the “visited” state of the GtkLinkButton. The button becomes visited when it is clicked. If the URI is changed on the button, the “visited” state is unset again. The state may also be changed using [method@Gtk.LinkButton.set_visited].

  • set_uri (string uri)

    Sets @uri as the URI where the GtkLinkButton points. As a side-effect this unsets the “visited” state of the button.

    • @p uri is a valid URI.
    • @r None.
  • set_visited (bool visited)

    Sets the “visited” state of the GtkLinkButton. See [method@Gtk.LinkButton.get_visited] for more details.

    • @p visited is the new “visited” state.
    • @r None.

class: LinkButtonActivatelinkCallback

[308:7] extends: object

Generated low-level callback wrapper for GIR callback activate-link.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • LinkButtonActivatelinkCallback (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, 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.