![]() |
![]() |
![]() |
GTK+ 3 Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties |
#include <gtk/gtk.h> struct GtkLockButton; GtkWidget * gtk_lock_button_new (GPermission *permission
); GPermission * gtk_lock_button_get_permission (GtkLockButton *button
); void gtk_lock_button_set_permission (GtkLockButton *button
,GPermission *permission
);
GObject +----GInitiallyUnowned +----GtkWidget +----GtkContainer +----GtkBin +----GtkButton +----GtkLockButton
GtkLockButton implements AtkImplementorIface, GtkBuildable and GtkActivatable.
"permission" GPermission* : Read / Write "text-lock" gchar* : Read / Write / Construct "text-unlock" gchar* : Read / Write / Construct "tooltip-lock" gchar* : Read / Write / Construct "tooltip-not-authorized" gchar* : Read / Write / Construct "tooltip-unlock" gchar* : Read / Write / Construct
GtkLockButton 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 GPermission object. Concrete implementations of GPermission may use PolicyKit or some other authorization framework.
If the user lacks the authorization but authorization can be obtained through authentication, the widget looks like this
and the user can click the button to obtain the authorization. Depending on the platform, this may pop up an authentication dialog or ask the user to authenticate in some other way. Once authorization is obtained, the widget changes to this
and the authorization can be dropped by clicking the button. If the user is not able to obtain authorization at all, the widget looks like this
If the user is authorized and cannot drop the authorization, the button is hidden.
The text (and tooltips) that are shown in the various cases can be adjusted with the "text-lock", "text-unlock", "tooltip-lock", "tooltip-unlock" and "tooltip-not-authorized" properties.
GtkWidget * gtk_lock_button_new (GPermission *permission
);
Creates a new lock button which reflects the permission
.
|
a GPermission. [allow-none] |
Returns : |
a new GtkLockButton |
Since 3.2
GPermission * gtk_lock_button_get_permission (GtkLockButton *button
);
Obtains the GPermission object that controls button
.
|
a GtkLockButton |
Returns : |
the GPermission of button
|
Since 3.2
void gtk_lock_button_set_permission (GtkLockButton *button
,GPermission *permission
);
Sets the GPermission object that controls button
.
|
a GtkLockButton |
|
a GPermission object, or NULL . [allow-none]
|
Since 3.2
"permission"
property "permission" GPermission* : Read / Write
The GPermission object controlling this button.
"text-lock"
property "text-lock" gchar* : Read / Write / Construct
The text to display when prompting the user to lock.
Default value: "Lock"
"text-unlock"
property "text-unlock" gchar* : Read / Write / Construct
The text to display when prompting the user to unlock.
Default value: "Unlock"
"tooltip-lock"
property "tooltip-lock" gchar* : Read / Write / Construct
The tooltip to display when prompting the user to lock.
Default value: "Dialog is unlocked.\nClick to prevent further changes"
"tooltip-not-authorized"
property "tooltip-not-authorized" gchar* : Read / Write / Construct
The tooltip to display when prompting the user cannot obtain authorization.
Default value: "System policy prevents changes.\nContact your system administrator"