FunctionGUI 0.1.0__tar.gz → 0.3.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.
- functiongui-0.3.0/FunctionGUI/FunctionGUI.py +98 -0
- {functiongui-0.1.0 → functiongui-0.3.0}/FunctionGUI/__init__.py +6 -1
- {functiongui-0.1.0 → functiongui-0.3.0}/FunctionGUI.egg-info/PKG-INFO +18 -5
- functiongui-0.3.0/FunctionGUI.egg-info/requires.txt +2 -0
- {functiongui-0.1.0 → functiongui-0.3.0}/PKG-INFO +18 -5
- {functiongui-0.1.0 → functiongui-0.3.0}/README.md +16 -4
- {functiongui-0.1.0 → functiongui-0.3.0}/setup.py +2 -1
- functiongui-0.1.0/FunctionGUI/FunctionGUI.py +0 -52
- functiongui-0.1.0/FunctionGUI.egg-info/requires.txt +0 -1
- {functiongui-0.1.0 → functiongui-0.3.0}/FunctionGUI.egg-info/SOURCES.txt +0 -0
- {functiongui-0.1.0 → functiongui-0.3.0}/FunctionGUI.egg-info/dependency_links.txt +0 -0
- {functiongui-0.1.0 → functiongui-0.3.0}/FunctionGUI.egg-info/top_level.txt +0 -0
- {functiongui-0.1.0 → functiongui-0.3.0}/setup.cfg +0 -0
@@ -0,0 +1,98 @@
|
|
1
|
+
|
2
|
+
import tkinter as tk
|
3
|
+
from tkinter import ttk
|
4
|
+
from ttkbootstrap import Style
|
5
|
+
from tkinter import font as tkfont
|
6
|
+
from PIL import Image, ImageTk
|
7
|
+
from tkinter import filedialog
|
8
|
+
|
9
|
+
|
10
|
+
def Window():
|
11
|
+
root = tk.Tk()
|
12
|
+
return root
|
13
|
+
|
14
|
+
def Title(root, title = "New Window"):
|
15
|
+
a = root.title(title)
|
16
|
+
return a
|
17
|
+
|
18
|
+
def Label(parent, text="Default Text", font="Helvetica", size=12, color="black"):
|
19
|
+
label = ttk.Label(parent, text=text, font = (font, size), foreground = color); label.pack();
|
20
|
+
return label
|
21
|
+
|
22
|
+
def Place(widget, x, y):
|
23
|
+
widget.place(x=x, y=y)
|
24
|
+
|
25
|
+
def Font(name = 'arial', size = 20, weight = "bold"):
|
26
|
+
font = tkfont.Font(name = name, size = size, weight = weight)
|
27
|
+
return font
|
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()
|
72
|
+
|
73
|
+
def BGImage(parent, bg_image_path = '', width=400 , height=300):
|
74
|
+
# Load and set the background image
|
75
|
+
bg_image = Image.open(bg_image_path)
|
76
|
+
bg_image = bg_image.resize((width, height), Image.ANTIALIAS)
|
77
|
+
bg_photo = ImageTk.PhotoImage(bg_image)
|
78
|
+
|
79
|
+
background_label = tk.Label(parent, image=bg_photo)
|
80
|
+
background_label.image = bg_photo # Keep a reference to avoid garbage collection
|
81
|
+
background_label.place(x=0, y=0, relwidth=1, relheight=1)
|
82
|
+
|
83
|
+
def Button(parent, text="Button", command=None, font="Helvetica", size=12, bg="black", fg="black", width=20, height=20, padx = 10, pady = 10):
|
84
|
+
button = tk.Button(parent, text=text, command=command, font=(font, size), bg=bg, fg=fg, width=width, height=height)
|
85
|
+
button.pack(padx=padx, pady=pady)
|
86
|
+
return button
|
87
|
+
|
88
|
+
def Entry(parent, width=20, font="Helvetica", size=12, bg="white", fg="black", padx = 10, pady = 10):
|
89
|
+
entry = ttk.Entry(parent, width=width, font=(font, size), background=bg, foreground=fg)
|
90
|
+
entry.pack(padx=padx, pady=pady)
|
91
|
+
return entry
|
92
|
+
|
93
|
+
def GetEntry(entry):
|
94
|
+
d = entry.get()
|
95
|
+
return entry
|
96
|
+
|
97
|
+
def Run(window):
|
98
|
+
window.mainloop()
|
@@ -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
|
@@ -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
|
@@ -35,13 +35,18 @@ fg.Title(root, "New Window")
|
|
35
35
|
# Create a custom font
|
36
36
|
custom_font = fg.Font(name='Helvetica', size=16, weight='bold')
|
37
37
|
|
38
|
-
# Create
|
38
|
+
# Create a label with the custom font
|
39
39
|
label = fg.Label(root, text="Hello, World!", font='Helvetica', size=16, color="blue")
|
40
40
|
|
41
|
-
# Create and place a button
|
42
|
-
button = fg.Button(root, text="Click Me", command=lambda: print("Button clicked!"))
|
43
41
|
|
44
|
-
#
|
42
|
+
# Add/pack a widget
|
43
|
+
fg.add(widget, padx = 10, pady = 10)
|
44
|
+
|
45
|
+
# Create and p
|
46
|
+
ChexBox(parent, text = 'check me', variable=None, command =lambda: print("Check Box")):
|
47
|
+
|
48
|
+
|
49
|
+
# Create an entry field
|
45
50
|
entry = fg.Entry(root, width=20, font="Helvetica", size=12, bg="white", fg="black", padx = 10, pady = 10)
|
46
51
|
|
47
52
|
# Retrieve and print the text from the entry field on button click
|
@@ -49,6 +54,13 @@ def on_button_click():
|
|
49
54
|
text = fg.GetEntry(entry)
|
50
55
|
print(text.get())
|
51
56
|
|
57
|
+
# Change the design of the app
|
58
|
+
style = fg.Design(theme)
|
59
|
+
|
60
|
+
# Boolean Variable (Use in checkboxes)
|
61
|
+
Boolean_Variable = BulleanVar()
|
62
|
+
|
63
|
+
# Add a Button
|
52
64
|
button = fg.Button(root, text="Print Entry", command=on_button_click)
|
53
65
|
|
54
66
|
# Set a background image
|
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|
2
2
|
|
3
3
|
setup(
|
4
4
|
name='FunctionGUI', # Replace with your library name
|
5
|
-
version='0.
|
5
|
+
version='0.3.0', # Start with an initial version
|
6
6
|
description='A simple Tkinter GUI library with basic widgets and functionality.',
|
7
7
|
long_description=open('README.md').read(), # Make sure you have a README.md file
|
8
8
|
long_description_content_type='text/markdown',
|
@@ -12,6 +12,7 @@ setup(
|
|
12
12
|
packages=find_packages(), # Automatically find packages in the directory
|
13
13
|
install_requires=[
|
14
14
|
'Pillow',
|
15
|
+
'ttkbootstrap'
|
15
16
|
],
|
16
17
|
classifiers=[
|
17
18
|
'Programming Language :: Python :: 3',
|
@@ -1,52 +0,0 @@
|
|
1
|
-
import tkinter as tk
|
2
|
-
from tkinter import ttk
|
3
|
-
|
4
|
-
from tkinter import font as tkfont
|
5
|
-
from PIL import Image, ImageTk
|
6
|
-
|
7
|
-
def Window():
|
8
|
-
root = tk.Tk()
|
9
|
-
return root
|
10
|
-
|
11
|
-
def Title(root, title = "New Window"):
|
12
|
-
a = root.title(title)
|
13
|
-
return a
|
14
|
-
|
15
|
-
def Label(parent, text="Default Text", font="Helvetica", size=12, color="black"):
|
16
|
-
label = ttk.Label(parent, text=text, font = (font, size), foreground = color); label.pack();
|
17
|
-
return label
|
18
|
-
|
19
|
-
def Place(widget, x, y):
|
20
|
-
widget.place(x=x, y=y)
|
21
|
-
|
22
|
-
def Font(name = 'arial', size = 20, weight = 10):
|
23
|
-
font = tkfont.Font(family=name, size=size, weight=weight)
|
24
|
-
return font
|
25
|
-
|
26
|
-
|
27
|
-
def BGImage(parent, bg_image_path = '', width=400 , height=300):
|
28
|
-
# Load and set the background image
|
29
|
-
bg_image = Image.open(bg_image_path)
|
30
|
-
bg_image = bg_image.resize((width, height), Image.ANTIALIAS)
|
31
|
-
bg_photo = ImageTk.PhotoImage(bg_image)
|
32
|
-
|
33
|
-
background_label = tk.Label(parent, image=bg_photo)
|
34
|
-
background_label.image = bg_photo # Keep a reference to avoid garbage collection
|
35
|
-
background_label.place(x=0, y=0, relwidth=1, relheight=1)
|
36
|
-
|
37
|
-
def Button(parent, text="Button", command=None, font="Helvetica", size=12, bg="black", fg="black", width=20, height=20, padx = 10, pady = 10):
|
38
|
-
button = tk.Button(parent, text=text, command=command, font=(font, size), bg=bg, fg=fg, width=width, height=height)
|
39
|
-
button.pack(padx=padx, pady=pady)
|
40
|
-
return button
|
41
|
-
|
42
|
-
def Entry(parent, width=20, font="Helvetica", size=12, bg="white", fg="black", padx = 10, pady = 10):
|
43
|
-
entry = ttk.Entry(parent, width=width, font=(font, size), background=bg, foreground=fg)
|
44
|
-
entry.pack(padx=padx, pady=pady)
|
45
|
-
return entry
|
46
|
-
|
47
|
-
def GetEntry(entry):
|
48
|
-
d = entry.get()
|
49
|
-
return entry
|
50
|
-
|
51
|
-
def Run(window):
|
52
|
-
window.mainloop()
|
@@ -1 +0,0 @@
|
|
1
|
-
Pillow
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|