Skip to content
LinuxEducation edited this page Oct 27, 2023 · 12 revisions

About Project

tesTk is based on the tkinter library. The first layer of each widget is a canvas, so you decide how the widget will look and change. You can create animations, draw your own controls, change widget shapes. You can also easily combine multiple widgets into one. Tkinter Canvas allows you to add any widgets you want: Frame, Button, Entry or Text, Images. Each pixel on the canvas, each object can be tagged by giving it a name, allowing you to change these objects or remove them.

example 1

from tkmodule import App
from src.widget_composition import WidgetComposition

class MyOwnWidget(WidgetComposition):
    pass

app = App()
widget = MyWidget(app)
widget.draw_widget()
widget.pack(expand=True)
app.mainloop()

example 2

from tkmodule import App
from src.widget_composition import WidgetComposition

class MyOwnWidget(WidgetComposition):
    widgetName = 'My Own Widget'

    def __init__(self, container, **kw):
        super().__init__(container, **kw)
        self.draw_widget()

    def draw_widget(self) -> None:
        print(MyOwnWidget.widgetName, 'is draw!')
        super().draw_widget()
        super().insert_text()


app = App()
MyOwnWidget(app, text='tesTk').pack()
app.mainloop()
Clone this wiki locally