gtk.lock_button
Module for [LockButton] class
Types 3
gtk.lock_button.LockButton is a widget to obtain and revoke authorizations needed to operate the controls.
It is typically used in preference dialogs or control panels.
The required authorization is represented by a gio.permission.Permission object. Concrete implementations of gio.permission.Permission may use PolicyKit or some other authorization framework. To obtain a PolicyKit-based gio.permission.Permission, 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:

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:

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:

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 gtk.lock_button.LockButton.textLock, gtk.lock_button.LockButton.textUnlock, gtk.lock_button.LockButton.tooltipLock, gtk.lock_button.LockButton.tooltipUnlock and gtk.lock_button.LockButton.tooltipNotAuthorized properties.
Deprecated
LockButtonGidBuilder builder() static nothrowGet builder for [gtk.lock_button.LockButton] Returns: New builder objectgio.permission.Permission permission() @property nothrowGet `permission` property. Returns: The `GPermission object controlling this button.void permission(gio.permission.Permission propval) @property nothrowSet `permission` property. Params: propval = The `GPermission object controlling this button.string textLock() @property nothrowGet `textLock` property. Returns: The text to display when prompting the user to lock.void textLock(string propval) @property nothrowSet `textLock` property. Params: propval = The text to display when prompting the user to lock.string textUnlock() @property nothrowGet `textUnlock` property. Returns: The text to display when prompting the user to unlock.void textUnlock(string propval) @property nothrowSet `textUnlock` property. Params: propval = The text to display when prompting the user to unlock.string tooltipLock() @property nothrowGet `tooltipLock` property. Returns: The tooltip to display when prompting the user to lock.void tooltipLock(string propval) @property nothrowSet `tooltipLock` property. Params: propval = The tooltip to display when prompting the user to lock.string tooltipNotAuthorized() @property nothrowGet `tooltipNotAuthorized` property. Returns: The tooltip to display when the user cannot obtain authorization.void tooltipNotAuthorized(string propval) @property nothrowSet `tooltipNotAuthorized` property. Params: propval = The tooltip to display when the user cannot obtain authorization.string tooltipUnlock() @property nothrowGet `tooltipUnlock` property. Returns: The tooltip to display when prompting the user to unlock.void tooltipUnlock(string propval) @property nothrowSet `tooltipUnlock` property. Params: propval = The tooltip to display when prompting the user to unlock.gio.permission.Permission getPermission() nothrowObtains the [gio.permission.Permission] object that controls button. Returns: the [gio.permission.Permission] of buttonvoid setPermission(gio.permission.Permission permission = null) nothrowSets the [gio.permission.Permission] object that controls button.this(gio.permission.Permission permission = null)Creates a new lock button which reflects the permission.Fluent builder implementation template for gtk.lock_button.LockButton
T permission(gio.permission.Permission propval) nothrowSet `permission` property. Params: propval = The `GPermission object controlling this button. Returns: Builder instance for fluent chainingT textLock(string propval) nothrowSet `textLock` property. Params: propval = The text to display when prompting the user to lock. Returns: Builder instance for fluent chainingT textUnlock(string propval) nothrowSet `textUnlock` property. Params: propval = The text to display when prompting the user to unlock. Returns: Builder instance for fluent chainingT tooltipLock(string propval) nothrowSet `tooltipLock` property. Params: propval = The tooltip to display when prompting the user to lock. Returns: Builder instance for fluent chainingT tooltipNotAuthorized(string propval) nothrowSet `tooltipNotAuthorized` property. Params: propval = The tooltip to display when the user cannot obtain authorization. Returns: Builder instance for fluent chainingT tooltipUnlock(string propval) nothrowSet `tooltipUnlock` property. Params: propval = The tooltip to display when prompting the user to unlock. Returns: Builder instance for fluent chainingFluent builder for gtk.lock_button.LockButton