FunctionGUI 0.1.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.
@@ -0,0 +1,52 @@
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()
@@ -0,0 +1,14 @@
1
+ # __init__.py
2
+
3
+ from .FunctionGUI import (
4
+ Window,
5
+ Title,
6
+ Label,
7
+ Place,
8
+ Font,
9
+ BGImage,
10
+ Button,
11
+ Entry,
12
+ GetEntry,
13
+ Run
14
+ )
@@ -0,0 +1,88 @@
1
+ Metadata-Version: 2.1
2
+ Name: FunctionGUI
3
+ Version: 0.1.0
4
+ Summary: A simple Tkinter GUI library with basic widgets and functionality.
5
+ Home-page: https://github.com/aa425/FunctionGUI
6
+ Author: Aaroh Charne
7
+ Author-email: aaroh.charne@gmail.com
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Natural Language :: English
14
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
15
+ Requires-Python: >=3.6
16
+ Description-Content-Type: text/markdown
17
+ Requires-Dist: Pillow
18
+
19
+ # FunctionGUI
20
+
21
+ FunctionGUI is a simple GUI library built using tkinter, designed to help you quickly create graphical user interfaces with ease.
22
+
23
+ ## Installation
24
+
25
+ To install FunctionGUI, you can simply use pip:
26
+
27
+ ```bash
28
+ pip install functiongui
29
+ ```
30
+
31
+ ```python
32
+ # FunctionGUI
33
+
34
+ FunctionGUI is a simple GUI library built using tkinter, designed to help you quickly create graphical user interfaces with ease. This library can currently complete the most basic tasks of Tkinter and does not contain much functionality, but will have more features in the future.
35
+
36
+ ## Installation
37
+
38
+ To install FunctionGUI, you can simply use pip:
39
+
40
+ ```bash
41
+ pip install functiongui
42
+ ```
43
+ ## Usage
44
+ ```python
45
+ import functiongui as fg
46
+
47
+ # Create a window
48
+ root = fg.Window()
49
+
50
+ # Set the title of the window
51
+ fg.Title(root, "New Window")
52
+
53
+ # Create a custom font
54
+ custom_font = fg.Font(name='Helvetica', size=16, weight='bold')
55
+
56
+ # Create and place a label with the custom font
57
+ label = fg.Label(root, text="Hello, World!", font='Helvetica', size=16, color="blue")
58
+
59
+ # Create and place a button
60
+ button = fg.Button(root, text="Click Me", command=lambda: print("Button clicked!"))
61
+
62
+ # Create and place an entry field
63
+ entry = fg.Entry(root, width=20, font="Helvetica", size=12, bg="white", fg="black", padx = 10, pady = 10)
64
+
65
+ # Retrieve and print the text from the entry field on button click
66
+ def on_button_click():
67
+ text = fg.GetEntry(entry)
68
+ print(text.get())
69
+
70
+ button = fg.Button(root, text="Print Entry", command=on_button_click)
71
+
72
+ # Set a background image
73
+ fg.BGImage(root, bg_image_path='path_to_image.jpg', width = 300, height = 600)
74
+
75
+ # Place a widget on a specific coordinate on the window
76
+ Place(button, 60, 100)
77
+
78
+ # Run the main loop
79
+ fg.Run(root)
80
+ ```
81
+
82
+ ## Bugs
83
+
84
+ If you are finding bugs in the code, please report them to me @aaroh.charne@gmail.com.
85
+ Please include a snippet of your code as well the problem. Thank You
86
+
87
+ ## Please check out my other Library Calclab @https://pypi.org/project/Calclab/
88
+ ```
@@ -0,0 +1,6 @@
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,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (71.0.4)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+ FunctionGUI