Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: LockButton

[39:7] extends: object

GtkLockButton is a widget to obtain and revoke authorizations needed to operate the controls. An example GtkLockButton It is typically used in preference dialogs or control panels. The required authorization is represented by a GPermission object. Concrete implementations of GPermission may use PolicyKit or some other authorization framework. To obtain a PolicyKit-based GPermission, use polkit_permission_new(). If the user is not currently allowed to perform the action, but can obtain the permission, the widget looks like this: An locked GtkLockButton and the user can click the button to request the permission. Depending on the platform, this may pop up an authentication dialog or ask the user to authenticate in some other way. Once the user has obtained the permission, the widget changes to this: An unlocked GtkLockButton and the permission can be dropped again by clicking the button. If the user is not able to obtain the permission at all, the widget looks like this: An unobtainable
GtkLockButton If the user has the permission and cannot drop it, the button is hidden. The text (and tooltips) that are shown in the various cases can be adjusted with the [property@Gtk.LockButton:text-lock], [property@Gtk.LockButton:text-unlock], [property@Gtk.LockButton:tooltip-lock], [property@Gtk.LockButton:tooltip-unlock] and [property@Gtk.LockButton:tooltip-not-authorized] properties.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • LockButton (permission = null)

    Creates a new lock button which reflects the @permission.

    • @p permission is a GPermission.
  • 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.
  • getProperty (string Name)

    Reads one generated property by name.

  • setProperty (string Name, Value)

    Writes one generated property by name.

  • setPermission (object Value)

    The `GPermission object controlling this button.

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

    The text to display when prompting the user to lock.

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

    The text to display when prompting the user to unlock.

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

    The tooltip to display when prompting the user to lock.

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

    The tooltip to display when the user cannot obtain authorization.

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

    The tooltip to display when prompting the user to unlock.

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

    Obtains the GPermission object that controls @button.

  • set_permission (object permission)

    Sets the GPermission object that controls @button.

    • @p permission is a GPermission object.
    • @r None.

class: LockButtonMeta

[280:14] static extends: object

Generated metadata helpers for LockButton class surfaces.

Methods

  • properties ()

    Returns property metadata for LockButton.

    • @r A list.