Creates a new lock button which reflects the permission.
Obtains the gio.permission.Permission object that controls button.
Sets the gio.permission.Permission object that controls button.
Creates a new button containing an icon from the current icon theme.
Creates a gtk.button.Button widget with a gtk.label.Label child.
Creates a new gtk.button.Button containing a label.
Retrieves whether the button can be smaller than the natural size of its contents.
Gets the child widget of button.
Returns whether the button has a frame.
Returns the icon name of the button.
Fetches the text from the label of the button.
gets whether underlines are interpreted as mnemonics.
Sets whether the button size can be smaller than the natural size of its contents.
Sets the child widget of button.
Sets the style of the button.
Adds a gtk.image.Image with the given icon name as a child.
Sets the text of the label of the button to label.
Sets whether to use underlines as mnemonics.
Connect to Activate signal.
Connect to Clicked signal.
Deprecated: This widget will be removed in GTK 5
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 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.