@@ -11,6 +11,18 @@ usage with Python. Simply follow the installation instructions and all
1111required files are installed to the site package directory.
1212
1313## Installation
14+ Currently, a build process for Linux and Windows is available. If you
15+ would like to use the package on OS X, please let me know so we can
16+ work on a build system.
17+
18+ ### Wheels
19+ Currently, wheels are provided for Windows. The Linux wheels are built
20+ with Travis-CI and are thus not ` manylinux ` wheels. Therefore, building
21+ yourself is recommended when using Linux (either from the source dist
22+ from PyPI or this repository). Feel free to open an issue if you
23+ encounter any problems building!
24+
25+ ### Linux
1426These instructions are for Ubuntu, Python 3.5 or higher. Any lower
1527version may work, but is not supported. On other distributions, package
1628names may be different.
@@ -25,16 +37,47 @@ python -m pip install scikit-build
2537python setup.py install
2638```
2739
40+ ### Windows (64-bit only)
41+ These instructions assume you have [ MSYS2] ( https://www.msys2.org/ )
42+ installed, with the MinGW toolchain. The ` setup.py ` script will check
43+ the additional build dependencies and install them when required.
44+
45+ Both the MSYS ` bin ` directory as well as the MinGW ` bin ` directory must
46+ be on the ` PATH ` to run the ` setup.py ` script. Usually, these folders
47+ are ` C:\msys64\usr\bin ` and ` C:\msys64\mingw64\bin ` , but they may differ
48+ for your installation.
49+
50+ In addition to this, the ` setup.py ` script expects the ` Dependencies `
51+ program found [ here] ( https://github.com/lucasg/Dependencies ) to be
52+ installed under ` deps/Dependencies.exe ` by default. This tool is used
53+ to find all DLL-files necessary to run ` gttk ` without any external files.
54+
55+ If you have satisfied all requirements, assuming you want to install
56+ the package * outside* of your MSYS installation:
57+ ``` bash
58+ # Replace C:\Python with the path to your Python setup
59+ # The MSYS version of Python is on PATH and thus you should use an abspath!
60+ C:\P ython\p ython.exe setup.py install
61+ ```
62+
63+ The binary distribution of ` gttk ` will come with all DLL-files known to
64+ be required to run it. These DLL-files are generally available under
65+ their own specific licenses, as covered in the files that are found in
66+ the MSYS directory ` /share/licenses ` .
67+
2868## Usage
29- Simply import the package, and the theme is loaded automatically.
69+ Simply import the package and instantiate the ` GTTK ` class. Then the
70+ theme will become available for usage in a ` ttk.Style ` .
3071``` python
3172import tkinter as tk
3273from tkinter import ttk
33- import gttk
74+ from gttk import GTTK
3475
3576window = tk.Tk()
77+ gttk = GTTK(window)
3678style = ttk.Style()
3779style.theme_use(" gttk" )
80+ print (gttk.get_current_theme()) # Prints the active GTK theme
3881ttk.Button(window, text = " Destroy" , command = window.destroy).pack()
3982
4083window.mainloop()
@@ -49,6 +92,30 @@ sys.path = sys.path[2:]
4992import gttk
5093```
5194
95+ ## Applying themes
96+ Themes are applied in the standard GTK+-2.0 manner: By reading a
97+ resource file. On ** Linux** , the GTK libraries that are installed will point
98+ ` gttk ` in the direction of the globally enabled GTK theme. Currently,
99+ no method for overriding this behaviour is available.
100+
101+ On ** Windows** , the behaviour is a little different. GTK will look for
102+ for the configuration files that point it towards the theme to be loaded
103+ in the files reported by
104+ ``` python
105+ GTTK .get_default_files()
106+ ```
107+ and themes should be placed in the folder
108+ ``` python
109+ GTTK .get_themes_directory()
110+ ```
111+
112+ A method for reliably loading user themes is being researched, but for
113+ now this is the way to go. A ` gtkrc ` file may for example simply be
114+ ``` gtkrc
115+ gtk-theme-name = "Yaru"
116+ ```
117+ where ` some_path_here/share/themes/Yaru ` is a valid GTK theme folder.
118+
52119## Screenshots
53120` gttk ` should work with any GTK theme you can throw at it, but below
54121are the themes Yaru and Adwaita as examples.
@@ -66,7 +133,7 @@ is available only under GNU GPLv3.
66133python-gttk
67134Copyright (c) 2008-2012 Georgios Petasis
68135Copyright (c) 2012 Cheer Xiao
69- Copyright (c) 2019-2020 Geballin
136+ Copyright (c) 2019-2020 Géballin
70137Copyright (c) 2020 RedFantom
71138
72139This program is free software: you can redistribute it and/or modify
0 commit comments