문제

GPermission seems to have little to no documentation. How do you actually use it? (I'm currently using it for a GTK LockButton).

도움이 되었습니까?

해결책

I agree, the documentation is pretty lacking. GPermission is an abstract base class which isn't particularly useful by itself. You need something which actually implements GPermission, like polkit.

There are some examples in gnome-control-center, like the datetime panel.

다른 팁

You need to subclass GPermission. When you need to change the values, you call g_permission_impl_update. Very non-intuitive, but yeah that's how it's done.

Google found me this straight away: https://developer.gnome.org/gio/2.26/GPermission.html

Is that not sufficient?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top