Gtk.LockButton - Classes - Gtk 3.0 (original) (raw)
g Atk.ImplementorIface Atk.ImplementorIface Gtk.Widget Gtk.Widget Atk.ImplementorIface->Gtk.Widget GObject.GInterface GObject.GInterface GObject.GInterface->Atk.ImplementorIface Gtk.Actionable Gtk.Actionable GObject.GInterface->Gtk.Actionable Gtk.Activatable Gtk.Activatable GObject.GInterface->Gtk.Activatable Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Button Gtk.Button Gtk.Actionable->Gtk.Button Gtk.Activatable->Gtk.Button Gtk.Bin Gtk.Bin Gtk.Bin->Gtk.Button Gtk.Buildable->Gtk.Widget Gtk.LockButton Gtk.LockButton Gtk.Button->Gtk.LockButton Gtk.Container Gtk.Container Gtk.Container->Gtk.Bin Gtk.Widget->Gtk.Container
Example¶
Subclasses:
None
Methods¶
Inherited:
Gtk.Button (29), Gtk.Bin (1), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10), Gtk.Actionable (5), Gtk.Activatable (6)
Structs:
Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)
class | new (permission) |
---|---|
get_permission () | |
set_permission (permission) |
Virtual Methods¶
Inherited:
Gtk.Button (6), Gtk.Container (10), Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10), Gtk.Actionable (4), Gtk.Activatable (2)
Properties¶
Inherited:
Gtk.Button (9), Gtk.Container (3), Gtk.Widget (39), Gtk.Actionable (2), Gtk.Activatable (2)
Name | Type | Flags | Short Description |
---|---|---|---|
permission | Gio.Permission | r/w | The Gio.Permission object controlling this button |
text-lock | str | r/w/c | The text to display when prompting the user to lock |
text-unlock | str | r/w/c | The text to display when prompting the user to unlock |
tooltip-lock | str | r/w/c | The tooltip to display when prompting the user to lock |
tooltip-not-authorized | str | r/w/c | The tooltip to display when prompting the user cannot obtain authorization |
tooltip-unlock | str | r/w/c | The tooltip to display when prompting the user to unlock |
Style Properties¶
Inherited:
Gtk.Button (7), Gtk.Widget (17)
Signals¶
Inherited:
Gtk.Button (6), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)
Fields¶
Inherited:
Gtk.Button (6), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)
Name | Type | Access | Description |
---|---|---|---|
parent | Gtk.Button | r |
Class Details¶
class Gtk.LockButton(*args, **kwargs)¶
Bases:
Abstract:
No
Structure:
Gtk.LockButton 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 Gio.Permission object. Concrete implementations of Gio.Permission may use PolicyKit or some other authorization framework. To obtain a PolicyKit-basedGio.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.LockButton :text-lock, Gtk.LockButton :text-unlock,Gtk.LockButton :tooltip-lock, Gtk.LockButton :tooltip-unlock andGtk.LockButton :tooltip-not-authorized properties.
classmethod new(permission)[source]¶
Parameters:
permission (Gio.Permission or None) – a Gio.Permission
Returns:
a new Gtk.LockButton
Return type:
Creates a new lock button which reflects the permission.
New in version 3.2.
Returns:
the Gio.Permission of self
Return type:
Obtains the Gio.Permission object that controls self.
New in version 3.2.
set_permission(permission)[source]¶
Parameters:
permission (Gio.Permission or None) – a Gio.Permission object, or None
Sets the Gio.Permission object that controls self.
New in version 3.2.
Property Details¶
Gtk.LockButton.props.permission¶
Name:
permission
Type:
Default Value:
Flags:
The Gio.Permission object controlling this button
Gtk.LockButton.props.text_lock¶
Name:
text-lock
Type:
Default Value:
'Lock'
Flags:
The text to display when prompting the user to lock
Gtk.LockButton.props.text_unlock¶
Name:
text-unlock
Type:
Default Value:
'Unlock'
Flags:
The text to display when prompting the user to unlock
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
Name:
tooltip-not-authorized
Type:
Default Value:
'System policy prevents changes.\nContact your system administrator'
Flags:
The tooltip to display when prompting the user cannot obtain authorization
Gtk.LockButton.props.tooltip_unlock¶
Name:
tooltip-unlock
Type:
Default Value:
'Dialog is locked.\nClick to make changes'
Flags:
The tooltip to display when prompting the user to unlock