• Stars
    star
    165
  • Rank 228,906 (Top 5 %)
  • Language Tcl
  • License
    MIT License
  • Created over 3 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A beautiful modern theme for ttk, inspired by MS Excel's look 🌲🌳

Forest theme for ttk

Partially based on my Azure theme

image image

How to use

Python / tkinter

To use the theme just import the forest-light.tcl, or the forest-dark.tcl file, and call the theme_use method to set the theme:

# Import the tcl file
root.tk.call('source', 'forest-light.tcl / forest-dark.tcl')

# Set the theme with the theme_use method
ttk.Style().theme_use('forest-light / forest-dark')

Tcl / tk

To use the theme just import the forest-light.tcl, or the forest-dark.tcl file, and call the theme use method to set the theme:

# Import the tcl file
source "forest-light.tcl / forest-dark.tcl"

# Set theme using the theme use method
ttk::style theme use forest-light / forest-dark

New style elements

The Forest theme similar to my Azure theme has some new widget styles, such as an accent button, toggle switch, toggle button and card. You can apply these with the style option.

If you need a highlighted button, use Accent.TButton:

button = ttk.Button(root, text='Accent button', style='Accent.TButton', command=callback)

To create a toggle button you need a checkbutton, to which you can apply the ToggleButton style:

togglebutton = ttk.Checkbutton(root, text='Toggle button', style='ToggleButton', variable=var)

The use of switches is becoming more common these days, so this theme has a Switch style, that can be applied to checkbuttons:

switch = ttk.Checkbutton(root, text='Switch', style='Switch', variable=var)

If you only want a border around your widgets, not an entire LabelFrame then apply the Card style to a Frame:

card = ttk.Frame(root, style='Card', padding=(5, 6, 7, 8))

A short example

for Python...

import tkinter as tk
from tkinter import ttk

root = tk.Tk()

# Import the tcl file
root.tk.call('source', 'forest-dark.tcl')

# Set the theme with the theme_use method
ttk.Style().theme_use('forest-dark')

# A themed (ttk) button
button = ttk.Button(root, text="I'm a themed button")
button.pack(pady=20)

root.mainloop()

...and for Tcl

package require Tk 8.6

# Import the tcl file
source "forest-dark.tcl"

# Set theme using the theme use method
ttk::style theme use forest-dark

# A themed (ttk) button
ttk::button .button -text "I'm a themed button"
pack .button -pady 20

More Repositories

1

Sun-Valley-ttk-theme

A gorgeous theme for Tkinter/ttk, based on the Sun Valley visual style ✨
Tcl
1,260
star
2

Azure-ttk-theme

A stunning modern theme for ttk inspired by Fluent Design πŸ’ 
Tcl
539
star
3

Sun-Valley-ttk-examples

Example apps for my stunning Sun Valley ttk theme!
Python
131
star
4

tkinterDnD

A nice and easy-to-use wrapper around the tkdnd package
Tcl
25
star
5

chlorophyll

A Tkinter widget that fills your code with color
Python
19
star
6

tkcode

Use Chlorophyll instead
Python
18
star
7

Sun-Valley-messageboxes

Not a Tkinter project. I'll use this in @Tukaan. Some people requested to share the code, so here it is.
Tcl
15
star
8

Brainfuck-IDE

A Brainfuck editor written in Tkinter
Python
14
star
9

tkinter-docs

A Pythonic Tkinter documentation. I've abandoned this project a while ago, but I plan to continue
HTML
13
star
10

tkpdf

Pdf viewer widget for Tkinter
Python
7
star
11

Beautiful-tkinter-examples

Just experimenting, how to make Tkinter/Ttk look more beautiful
Tcl
7
star
12

flake8-tkinter

A flake8 plugin that helps you write better Tkinter code
Python
7
star
13

Sun-Valley-ttk-theme-svg

A stunning theme for ttk based on Microsoft's Sun Valley visual style. This time with SVG images.
Tcl
6
star
14

tkupgrade

Tool that rewrites Tkinter apps to use the Tukaan toolkit
Python
3
star
15

MovedtoGitLab

3
star
16

ttk-widget-factory

A useful widget appearance tester for ttk
Python
2
star
17

tktext

A text editor widget with spell checking and advanced text formatting options
Python
2
star
18

Pico-UI-kit

A library to easily work with electronic components using Raspberry Pi Pico
Python
2
star
19

rdbende.github.io

CSS
2
star
20

rdbende

Me
2
star
21

better-pygubu-designer

My customized Pygubu Designer with Sun Valley theme
Python
1
star
22

porcu-sv-ttk

Plugin to use the Sun Valley ttk theme in Porcupine
Python
1
star