pytklib 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
pytklib-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,5 @@
1
+ Metadata-Version: 2.4
2
+ Name: pytklib
3
+ Version: 0.1.0
4
+ Summary: Easy Tkinter helper library
5
+ Author: Luvdisc
@@ -0,0 +1,10 @@
1
+ [build-system]
2
+ requires = ["setuptools"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "pytklib"
7
+ version = "0.1.0"
8
+ description = "Easy Tkinter helper library"
9
+ authors = [{ name = "Luvdisc" }]
10
+ dependencies = []
@@ -0,0 +1 @@
1
+ from .core import *
@@ -0,0 +1,68 @@
1
+ from tkinter import Tk, Button, Label, PhotoImage
2
+
3
+
4
+ global btn1, btn2, btn3, initvarsdone
5
+ root = Tk()
6
+ root.title("Pytklib Base Title")
7
+ root.geometry("400x300")
8
+
9
+ labels = []
10
+ buttons = []
11
+ pics = []
12
+ initvarsdone = False
13
+ def change_title(title):
14
+ root.title(title)
15
+ def startwin():
16
+ global btn1, btn2, btn3
17
+ root.mainloop()
18
+
19
+
20
+ from tkinter import Button, PhotoImage
21
+
22
+ def add_button(text, command, x, y, image_path=None, width=None, height=None, bg=None, fg=None):
23
+
24
+ if image_path:
25
+ img = PhotoImage(file=image_path)
26
+ btn = Button(root, image=img, command=command)
27
+ btn.image = img # keep reference!
28
+ else:
29
+ btn = Button(root, text=text, command=command)
30
+
31
+ if width: btn.config(width=width)
32
+ if height: btn.config(height=height)
33
+ if bg: btn.config(bg=bg)
34
+ if fg: btn.config(fg=fg)
35
+
36
+ btn.place(x=x, y=y)
37
+ buttons.append(btn)
38
+ return btn
39
+
40
+ def initvars():
41
+ global btn1, btn2, btn3, initvarsdone
42
+
43
+ btn1 = ""
44
+ btn2 = ""
45
+ btn3 = ""
46
+ initvarsdone = True
47
+ def change_geometry(x, y):
48
+ root.geometry(f"{x}x{y}")
49
+ def add_label(text, x, y):
50
+ lbl = Label(root, text=text)
51
+ lbl.place(x=x, y=y)
52
+ labels.append(lbl)
53
+ return lbl
54
+ def loop():
55
+ startwin()
56
+ def add_photo_lbl(path, x, y):
57
+ img = PhotoImage(file=path)
58
+ img_lbl = Label(root, image=img)
59
+ img_lbl.place(x=x, y=y)
60
+ img_lbl.image = img
61
+ pics.append(img_lbl)
62
+
63
+ return img_lbl
64
+
65
+ def easysetup(geox, geoy, title):
66
+ change_geometry(geox, geoy)
67
+ change_title(title)
68
+ initvars()
@@ -0,0 +1,5 @@
1
+ Metadata-Version: 2.4
2
+ Name: pytklib
3
+ Version: 0.1.0
4
+ Summary: Easy Tkinter helper library
5
+ Author: Luvdisc
@@ -0,0 +1,7 @@
1
+ pyproject.toml
2
+ pytklib/__init__.py
3
+ pytklib/core.py
4
+ pytklib.egg-info/PKG-INFO
5
+ pytklib.egg-info/SOURCES.txt
6
+ pytklib.egg-info/dependency_links.txt
7
+ pytklib.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ pytklib
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+