LockButton


Object Hierarchy:

Object hierarchy for LockButton

Description:

[ CCode ( type_id = "gtk_lock_button_get_type ()" ) ]
public class LockButton : Button, Implementor, Actionable, Activatable, Buildable

`GtkLockButton` is a widget to obtain and revoke authorizations needed to operate the controls.

Note:

This widget will be removed in GTK 5

<picture> <source srcset="lockbutton-dark.png" media="(prefers-color-scheme: dark)"> <img alt="An example GtkLockButton" src="lockbutton.png"> </picture>

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:

<picture> <source srcset="lockbutton-dark.png" media="(prefers-color-scheme: dark)"> <img alt="An locked GtkLockButton" src="lockbutton.png"> </picture>

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:

<picture> <source srcset="lockbutton-unlocked-dark.png" media="(prefers-color-scheme: dark)"> <img alt="An unlocked GtkLockButton" src="lockbutton-unlocked.png"> </picture>

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:

<picture> <source srcset="lockbutton-sorry-dark.png" media="(prefers-color-scheme: dark)"> <img alt="An unobtainable GtkLockButton" src="lockbutton-sorry.png"> </picture>

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.


Namespace: Gtk
Package: gtk+-3.0

Content:

Properties:

Creation methods:

Methods:

Inherited Members:

All known members inherited from class Gtk.Bin
All known members inherited from class Gtk.Widget
All known members inherited from interface Atk.Implementor