Python Forum
[Tutorial] PyGtk3 How To Change Applicaton Theme - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: GUI (https://python-forum.io/forum-10.html)
+--- Thread: [Tutorial] PyGtk3 How To Change Applicaton Theme (/thread-2851.html)



[Tutorial] PyGtk3 How To Change Applicaton Theme - harun2525 - Apr-15-2017

changing app theme in PyGtk3 is very easy. look at  following code.

import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk as gtk

settings = gtk.Settings.get_default()
settings.set_property("gtk-theme-name", "Numix")
settings.set_property("gtk-application-prefer-dark-theme", False)  # if you want use dark theme, set second arg to True

# getting all existing properties #

for i in settings.list_properties():
    print(i)
Note: i couldn't post this thread in Fourm>Tutorials>GUI so i posted in here. Please do not delete this thread, only just move it