Toy window manager in the style of Windows 3.x on Tkinter
- Create new windows
- Drag and resize windows
- Minimize, maximize and close windows
- Create child windows inside other windows
- Context menus for windows
- Window focus
Warning! These programs are only demo versions to demonstrate the manager's work and do not have useful functionality.
- Terminal - toy command line
- Notepad - toy notepad
- Calculator - calculator with support for basic operations
You can write your own program, see the instructions below
The program requires the pillow library to work. You can install it with the command pip install pillow
Run python main.py
to start
To add your own program to the manager, create a file of your program in the sources\program
directory, for example test.py
.
Then you can write your code. But you should keep in mind that the main class of your program should inherit from tkinter.Frame
Example:
import tkinter as tk
class Test(tk.Frame):
def __init__(self, parent=None):
super().__init__(parent)
self.text_area = tk.Text(
self, wrap=tk.WORD, width=40, height=10, font=("Fixedsys", 12))
self.text_area.pack(fill="both", expand=True)
Then in main.py
import your program and add something like
import tkinter as tk
...
from sources.program.test import Test
def main():
...
app.create_window(title="Test", content=Test,
size=(50, 200, 500, 300), flags=WindowFlags.WN_RESIZABLE)
...
There are:
title
- this is the title of your windowcontent
- the object of your programsize
- coordinates and size of the windowflags
- window flags
A little about flags. 'WN' means 'Window Not', so 'WN_DRAGABLE' means 'Window Not Dragable', 'WN_RESIZABLE' means 'Window Not Resizable', and so on. There are 3 of them:
- WN_CONTROLS
- WN_DRAGABLE
- WN_RESIZABLE