gtk.lock_button

Module for [LockButton] class

Types 3

GtkLockButton is a widget that can be used in control panels or preference dialogs to allow users to obtain and revoke authorizations needed to operate the controls. 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:

![](lockbutton-locked.png)

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:

![](lockbutton-unlocked.png)

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:

![](lockbutton-sorry.png)

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 #GtkLockButton:text-lock, #GtkLockButton:text-unlock, #GtkLockButton:tooltip-lock, #GtkLockButton:tooltip-unlock and #GtkLockButton:tooltip-not-authorized properties.

Methods
GType _gType() @property
LockButton self()Returns `this`, for use in `with` statements.
LockButtonGidBuilder builder()Get builder for [gtk.lock_button.LockButton] Returns: New builder object
void permission(gio.permission.Permission propval) @property
string textLock() @property
void textLock(string propval) @property
string textUnlock() @property
void textUnlock(string propval) @property
string tooltipLock() @property
void tooltipLock(string propval) @property
string tooltipNotAuthorized() @property
void tooltipNotAuthorized(string propval) @property
string tooltipUnlock() @property
void tooltipUnlock(string propval) @property
gio.permission.Permission getPermission()Obtains the #GPermission object that controls button. Returns: the #GPermission of button
void setPermission(gio.permission.Permission permission = null)Sets the #GPermission object that controls button.
Constructors
this(void * ptr, Flag!"Take" take)
this(gio.permission.Permission permission = null)Creates a new lock button which reflects the permission.
Methods
T textLock(string propval)
T textUnlock(string propval)
T tooltipLock(string propval)
T tooltipNotAuthorized(string propval)
T tooltipUnlock(string propval)

Fluent builder for [gtk.lock_button.LockButton]

Methods