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 _getGType() static nothrow
GType _gType() @property nothrow
LockButton self() nothrowReturns `this`, for use in `with` statements.
LockButtonGidBuilder builder() static nothrowGet builder for [gtk.lock_button.LockButton] Returns: New builder object
void permission(gio.permission.Permission propval) @property nothrow
string textLock() @property nothrow
void textLock(string propval) @property nothrow
string textUnlock() @property nothrow
void textUnlock(string propval) @property nothrow
string tooltipLock() @property nothrow
void tooltipLock(string propval) @property nothrow
string tooltipNotAuthorized() @property nothrow
void tooltipNotAuthorized(string propval) @property nothrow
string tooltipUnlock() @property nothrow
void tooltipUnlock(string propval) @property nothrow
gio.permission.Permission getPermission() nothrowObtains the #GPermission object that controls button. Returns: the #GPermission of button
void setPermission(gio.permission.Permission permission = null) nothrowSets 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.

Fluent builder implementation template for gtk.lock_button.LockButton

Methods
T textLock(string propval) nothrow
T textUnlock(string propval) nothrow
T tooltipLock(string propval) nothrow
T tooltipNotAuthorized(string propval) nothrow
T tooltipUnlock(string propval) nothrow

Fluent builder for gtk.lock_button.LockButton

Methods
LockButton build() nothrowCreate object from builder. Returns: New object