Gtk.LockButton¶
Example¶
- Subclasses:
None
Methods¶
- Inherited:
Gtk.Button (16), Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1), Gtk.Actionable (5)
- Structs:
class |
|
|
Virtual Methods¶
Properties¶
- Inherited:
Gtk.Button (6), Gtk.Widget (34), Gtk.Accessible (1), Gtk.Actionable (2)
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
|
||
r/w/c |
|
||
r/w/c |
|
||
r/w/c |
|
||
r/w/c |
|
||
r/w/c |
|
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Gtk.LockButton(**kwargs)¶
- Bases:
- Abstract:
No
GtkLockButton
is a widget to obtain and revoke authorizations needed to operate the controls.An example
Gtk.LockButton
It is typically used in preference dialogs or control panels.
The required authorization is represented by a
GPermission
object. Concrete implementations ofGPermission
may use PolicyKit or some other authorization framework. To obtain a PolicyKit-basedGPermission
, usepolkit_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.
Deprecated since version 4.10: This widget will be removed in GTK 5
- classmethod new(permission)[source]¶
- Parameters:
permission (
Gio.Permission
orNone
) – aGPermission
- Returns:
a new
GtkLockButton
- Return type:
Creates a new lock button which reflects the permission.
Deprecated since version 4.10: This widget will be removed in GTK 5
- get_permission()[source]¶
- Returns:
the
GPermission
of self- Return type:
Obtains the
GPermission
object that controls self.Deprecated since version 4.10: This widget will be removed in GTK 5
- set_permission(permission)[source]¶
- Parameters:
permission (
Gio.Permission
orNone
) – aGPermission
object
Sets the
GPermission
object that controls self.Deprecated since version 4.10: This widget will be removed in GTK 5
Property Details¶
- Gtk.LockButton.props.permission¶
- Name:
permission
- Type:
- Default Value:
- Flags:
The `:obj:Gio.Permission object controlling this button.
Deprecated since version 4.10: This widget will be removed in GTK 5
- Gtk.LockButton.props.text_lock¶
-
The text to display when prompting the user to lock.
Deprecated since version 4.10: This widget will be removed in GTK 5
- Gtk.LockButton.props.text_unlock¶
-
The text to display when prompting the user to unlock.
Deprecated since version 4.10: This widget will be removed in GTK 5
- Gtk.LockButton.props.tooltip_lock¶
- Name:
tooltip-lock
- Type:
- Default Value:
'Dialog is unlocked.\nClick to prevent further changes'
- Flags:
The tooltip to display when prompting the user to lock.
Deprecated since version 4.10: This widget will be removed in GTK 5
- Gtk.LockButton.props.tooltip_not_authorized¶
- Name:
tooltip-not-authorized
- Type:
- Default Value:
'System policy prevents changes.\nContact your system administrator'
- Flags:
The tooltip to display when the user cannot obtain authorization.
Deprecated since version 4.10: This widget will be removed in GTK 5