Skip to content

Commit 822872a

Browse files
committed
Update README.md and bump to v0.6.0
1 parent 9404e41 commit 822872a

File tree

3 files changed

+72
-5
lines changed

3 files changed

+72
-5
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ PROJECT ( gttk )
77
## Package version information.
88
SET ( PKG_NAME ${PROJECT_NAME} )
99
SET ( PKG_MAJOR_VERSION 0 )
10-
SET ( PKG_MINOR_VERSION 5 )
10+
SET ( PKG_MINOR_VERSION 6 )
1111
SET ( PKG_BUILD_VERSION 0 )
1212
SET ( PKG_VERSION "${PKG_MAJOR_VERSION}.${PKG_MINOR_VERSION}" )
1313
SET ( PKG_NAME_VERSION ${PKG_NAME}-${PKG_VERSION} )

README.md

Lines changed: 70 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,18 @@ usage with Python. Simply follow the installation instructions and all
1111
required 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
1426
These instructions are for Ubuntu, Python 3.5 or higher. Any lower
1527
version may work, but is not supported. On other distributions, package
1628
names may be different.
@@ -25,16 +37,47 @@ python -m pip install scikit-build
2537
python 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:\Python\python.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
3172
import tkinter as tk
3273
from tkinter import ttk
33-
import gttk
74+
from gttk import GTTK
3475

3576
window = tk.Tk()
77+
gttk = GTTK(window)
3678
style = ttk.Style()
3779
style.theme_use("gttk")
80+
print(gttk.get_current_theme()) # Prints the active GTK theme
3881
ttk.Button(window, text="Destroy", command=window.destroy).pack()
3982

4083
window.mainloop()
@@ -49,6 +92,30 @@ sys.path = sys.path[2:]
4992
import 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
54121
are the themes Yaru and Adwaita as examples.
@@ -66,7 +133,7 @@ is available only under GNU GPLv3.
66133
python-gttk
67134
Copyright (c) 2008-2012 Georgios Petasis
68135
Copyright (c) 2012 Cheer Xiao
69-
Copyright (c) 2019-2020 Geballin
136+
Copyright (c) 2019-2020 Géballin
70137
Copyright (c) 2020 RedFantom
71138
72139
This program is free software: you can redistribute it and/or modify

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def copy_to_target(self, target: str):
172172

173173
setup(
174174
name="gttk",
175-
version="0.1.0",
175+
version="v0.6.0",
176176
packages=["gttk"],
177177
description="GTK theme for Tkinter/ttk",
178178
author="The gttk/tile-gtk/gttk authors",

0 commit comments

Comments
 (0)