Detect dark mode

Linux specific forum
coco2
Enthusiast
Enthusiast
Posts: 461
Joined: Mon Nov 25, 2013 5:38 am
Location: Australia

Detect dark mode

Post by coco2 »

I've been using this code:

Code: Select all

Procedure.i isDarkModeLinux()
  Protected boolVal.i, *Settings
  *Settings = gtk_settings_get_default_()
  If *Settings
    g_object_get_(*Settings, "gtk-application-prefer-dark-theme", @boolVal);
    ProcedureReturn boolVal
  EndIf
EndProcedure
But recently it's been giving this warning:
[WARNING] GLib-GObject (CRITICAL): g_object_get_is_valid_property: object class 'GtkSettings' has no property named 'W'
Anyone know what is happening?
User avatar
mk-soft
Always Here
Always Here
Posts: 6244
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Detect dark mode

Post by mk-soft »

My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Post Reply