Python Forum
[Tutorial] PyGtk3 How To Change Applicaton Theme
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tutorial] PyGtk3 How To Change Applicaton Theme
#1
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tkinter] Theme does not change globally TheTechRobo 2 3,320 Apr-21-2020, 04:00 PM
Last Post: deanhystad
  How can I get Colors of current GTK theme? ondoho 2 6,340 May-26-2017, 03:32 PM
Last Post: ondoho
  PyGtk3, No Module Named gi, on python3.5 on Windows harun2525 8 34,323 May-19-2017, 01:30 PM
Last Post: snippsat
  pygtk3, how to change application theme ? harun2525 7 7,236 May-10-2017, 08:42 PM
Last Post: harun2525
  PyGtk3, How to Create “title-changed” signal for Gtk.Window Widget? harun2525 2 6,034 May-01-2017, 07:59 AM
Last Post: harun2525
  PyGTK3, I can't Change Button and Table Backgorund Color using modify_bg method. harun2525 3 9,080 Apr-24-2017, 04:05 PM
Last Post: changos
  PyGTK3, How to Print All Existing Signal ? harun2525 1 3,174 Apr-16-2017, 02:57 PM
Last Post: Larz60+
  PyGtk3 why is Locale Folder Size Half of Module Size ? harun2525 1 3,582 Mar-09-2017, 03:46 AM
Last Post: Analyser
  How do I install small size pygtk3 harun2525 0 2,888 Feb-27-2017, 12:53 AM
Last Post: harun2525

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020