FunctionGUI 0.1.0__py3-none-any.whl → 0.3.0__py3-none-any.whl
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.
- FunctionGUI/FunctionGUI.py +49 -3
- FunctionGUI/__init__.py +6 -1
- {FunctionGUI-0.1.0.dist-info → FunctionGUI-0.3.0.dist-info}/METADATA +18 -5
- FunctionGUI-0.3.0.dist-info/RECORD +6 -0
- {FunctionGUI-0.1.0.dist-info → FunctionGUI-0.3.0.dist-info}/WHEEL +1 -1
- FunctionGUI-0.1.0.dist-info/RECORD +0 -6
- {FunctionGUI-0.1.0.dist-info → FunctionGUI-0.3.0.dist-info}/top_level.txt +0 -0
FunctionGUI/FunctionGUI.py
CHANGED
@@ -1,8 +1,11 @@
|
|
1
|
+
|
1
2
|
import tkinter as tk
|
2
3
|
from tkinter import ttk
|
3
|
-
|
4
|
+
from ttkbootstrap import Style
|
4
5
|
from tkinter import font as tkfont
|
5
6
|
from PIL import Image, ImageTk
|
7
|
+
from tkinter import filedialog
|
8
|
+
|
6
9
|
|
7
10
|
def Window():
|
8
11
|
root = tk.Tk()
|
@@ -19,10 +22,53 @@ def Label(parent, text="Default Text", font="Helvetica", size=12, color="black")
|
|
19
22
|
def Place(widget, x, y):
|
20
23
|
widget.place(x=x, y=y)
|
21
24
|
|
22
|
-
def Font(name = 'arial', size = 20, weight =
|
23
|
-
font = tkfont.Font(
|
25
|
+
def Font(name = 'arial', size = 20, weight = "bold"):
|
26
|
+
font = tkfont.Font(name = name, size = size, weight = weight)
|
24
27
|
return font
|
25
28
|
|
29
|
+
def OpenFile(title):
|
30
|
+
file_path = filedialog.askopenfilename(title="Select a file")
|
31
|
+
return file_path
|
32
|
+
def ChexBox(parent, text = 'check me', variable=None, command = None):
|
33
|
+
checkbutton = ttk.Checkbutton(parent, text=text, variable=variable, command=command)
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
def add(widget, padx = 10, pady = 10):
|
38
|
+
widget.pack(padx = padx, pady = pady)
|
39
|
+
|
40
|
+
def BGImage(parent, bg_image_path = '', width=400 , height=300):
|
41
|
+
# Load and set the background image
|
42
|
+
bg_image = Image.open(bg_image_path)
|
43
|
+
bg_image = bg_image.resize((width, height), Image.ANTIALIAS)
|
44
|
+
bg_photo = ImageTk.PhotoImage(bg_image)
|
45
|
+
|
46
|
+
background_label = tk.Label(parent, image=bg_photo)
|
47
|
+
background_label.image = bg_photo # Keep a reference to avoid garbage collection
|
48
|
+
background_label.place(x=0, y=0, relwidth=1, relheight=1)
|
49
|
+
|
50
|
+
def Button(parent, text="Button", command=None, font="Helvetica", size=12, bg="black", fg="black", width=20, height=20):
|
51
|
+
button = tk.Button(parent, text=text, command=command, font=(font, size), bg=bg, fg=fg, width=width, height=height)
|
52
|
+
return button
|
53
|
+
|
54
|
+
def Entry(parent, width=20, font="Helvetica", size=12, bg="white", fg="black"):
|
55
|
+
entry = ttk.Entry(parent, width=width, font=(font, size), background=bg, foreground=fg)
|
56
|
+
return entry
|
57
|
+
|
58
|
+
def GetEntry(entry):
|
59
|
+
d = entry.get()
|
60
|
+
return entry
|
61
|
+
|
62
|
+
def Design(theme):
|
63
|
+
style = Style(theme=theme)
|
64
|
+
return style
|
65
|
+
|
66
|
+
def BulleanVar():
|
67
|
+
Variable = tk.BooleanVar()
|
68
|
+
return Variable
|
69
|
+
|
70
|
+
def Run(window):
|
71
|
+
window.mainloop()
|
26
72
|
|
27
73
|
def BGImage(parent, bg_image_path = '', width=400 , height=300):
|
28
74
|
# Load and set the background image
|
FunctionGUI/__init__.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: FunctionGUI
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.3.0
|
4
4
|
Summary: A simple Tkinter GUI library with basic widgets and functionality.
|
5
5
|
Home-page: https://github.com/aa425/FunctionGUI
|
6
6
|
Author: Aaroh Charne
|
@@ -15,6 +15,7 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
15
15
|
Requires-Python: >=3.6
|
16
16
|
Description-Content-Type: text/markdown
|
17
17
|
Requires-Dist: Pillow
|
18
|
+
Requires-Dist: ttkbootstrap
|
18
19
|
|
19
20
|
# FunctionGUI
|
20
21
|
|
@@ -53,13 +54,18 @@ fg.Title(root, "New Window")
|
|
53
54
|
# Create a custom font
|
54
55
|
custom_font = fg.Font(name='Helvetica', size=16, weight='bold')
|
55
56
|
|
56
|
-
# Create
|
57
|
+
# Create a label with the custom font
|
57
58
|
label = fg.Label(root, text="Hello, World!", font='Helvetica', size=16, color="blue")
|
58
59
|
|
59
|
-
# Create and place a button
|
60
|
-
button = fg.Button(root, text="Click Me", command=lambda: print("Button clicked!"))
|
61
60
|
|
62
|
-
#
|
61
|
+
# Add/pack a widget
|
62
|
+
fg.add(widget, padx = 10, pady = 10)
|
63
|
+
|
64
|
+
# Create and p
|
65
|
+
ChexBox(parent, text = 'check me', variable=None, command =lambda: print("Check Box")):
|
66
|
+
|
67
|
+
|
68
|
+
# Create an entry field
|
63
69
|
entry = fg.Entry(root, width=20, font="Helvetica", size=12, bg="white", fg="black", padx = 10, pady = 10)
|
64
70
|
|
65
71
|
# Retrieve and print the text from the entry field on button click
|
@@ -67,6 +73,13 @@ def on_button_click():
|
|
67
73
|
text = fg.GetEntry(entry)
|
68
74
|
print(text.get())
|
69
75
|
|
76
|
+
# Change the design of the app
|
77
|
+
style = fg.Design(theme)
|
78
|
+
|
79
|
+
# Boolean Variable (Use in checkboxes)
|
80
|
+
Boolean_Variable = BulleanVar()
|
81
|
+
|
82
|
+
# Add a Button
|
70
83
|
button = fg.Button(root, text="Print Entry", command=on_button_click)
|
71
84
|
|
72
85
|
# Set a background image
|
@@ -0,0 +1,6 @@
|
|
1
|
+
FunctionGUI/FunctionGUI.py,sha256=nSK7EN07HGH_0mCvt-jtwXk8VPE8W6LS-B5VHkt8Cbc,3422
|
2
|
+
FunctionGUI/__init__.py,sha256=AWuhfVlsrkV3xq9ZCl1gfVqBoRqqzrNr2UwuRUJtnGA,227
|
3
|
+
FunctionGUI-0.3.0.dist-info/METADATA,sha256=6sHY8u4ocp0sS3IALLJ7qAwerrZLmBJvBUBdnoHiWYs,2942
|
4
|
+
FunctionGUI-0.3.0.dist-info/WHEEL,sha256=Wyh-_nZ0DJYolHNn1_hMa4lM7uDedD_RGVwbmTjyItk,91
|
5
|
+
FunctionGUI-0.3.0.dist-info/top_level.txt,sha256=_gisKDTO1FqIkJYqH6X1ZrcA0ZvQdKnA_JhABqCSUFo,12
|
6
|
+
FunctionGUI-0.3.0.dist-info/RECORD,,
|
@@ -1,6 +0,0 @@
|
|
1
|
-
FunctionGUI/FunctionGUI.py,sha256=iqHp_vPGsVlO1fgTCvAdrcSNHcQNaXZKG8sQTph4NA4,1804
|
2
|
-
FunctionGUI/__init__.py,sha256=AaP8wV9VTCZQnkjCjNKd8vQdLquGJUxW1SM554vOh1M,171
|
3
|
-
FunctionGUI-0.1.0.dist-info/METADATA,sha256=lUVX7KbEFOc3nEAddEx6F8ApypliG6KBe-hgIcwi0sE,2725
|
4
|
-
FunctionGUI-0.1.0.dist-info/WHEEL,sha256=rWxmBtp7hEUqVLOnTaDOPpR-cZpCDkzhhcBce-Zyd5k,91
|
5
|
-
FunctionGUI-0.1.0.dist-info/top_level.txt,sha256=_gisKDTO1FqIkJYqH6X1ZrcA0ZvQdKnA_JhABqCSUFo,12
|
6
|
-
FunctionGUI-0.1.0.dist-info/RECORD,,
|
File without changes
|