Page 1 of 1

Detect dark mode

Posted: Tue Mar 18, 2025 10:05 pm
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?

Re: Detect dark mode

Posted: Wed Mar 19, 2025 5:38 pm
by mk-soft