newtk 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.
- newtk-0.1.0/LICENSE +0 -0
- newtk-0.1.0/PKG-INFO +14 -0
- newtk-0.1.0/README.md +2 -0
- newtk-0.1.0/pyproject.toml +17 -0
- newtk-0.1.0/setup.cfg +4 -0
- newtk-0.1.0/src/newtk/__init__.py +8 -0
- newtk-0.1.0/src/newtk/newtk.py +52 -0
- newtk-0.1.0/src/newtk.egg-info/PKG-INFO +14 -0
- newtk-0.1.0/src/newtk.egg-info/SOURCES.txt +9 -0
- newtk-0.1.0/src/newtk.egg-info/dependency_links.txt +1 -0
- newtk-0.1.0/src/newtk.egg-info/top_level.txt +1 -0
newtk-0.1.0/LICENSE
ADDED
|
File without changes
|
newtk-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: newtk
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: newtk is a modern, lightweight GUI enhancement library for Python's built-in `tkinter`.
|
|
5
|
+
Author-email: cjq <mycjq20111204@outlook.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Keywords: tkinter,gui,animation,ui,modern,hover-effects
|
|
8
|
+
Requires-Python: >=3.8
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Dynamic: license-file
|
|
12
|
+
|
|
13
|
+
#newtk
|
|
14
|
+
newtk is a modern, lightweight GUI enhancement library for Python's built-in `tkinter`. It is designed to bring sleek animations and interactive effects to your desktop applications with minimal code.
|
newtk-0.1.0/README.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "newtk"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "newtk is a modern, lightweight GUI enhancement library for Python's built-in `tkinter`. "
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.8"
|
|
11
|
+
license = {text = "MIT"}
|
|
12
|
+
authors = [
|
|
13
|
+
{name = "cjq", email = "mycjq20111204@outlook.com"}
|
|
14
|
+
]
|
|
15
|
+
keywords = ["tkinter", "gui", "animation", "ui", "modern", "hover-effects"]
|
|
16
|
+
dependencies = []
|
|
17
|
+
|
newtk-0.1.0/setup.cfg
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import tkinter as tk
|
|
2
|
+
class Weight():
|
|
3
|
+
def __init__(self,root,bg=None):
|
|
4
|
+
self.root=root
|
|
5
|
+
self.bg=bg
|
|
6
|
+
self.Transparency=0
|
|
7
|
+
self.out=1
|
|
8
|
+
def Fade_in(self):
|
|
9
|
+
self.root.attributes('-alpha',0)
|
|
10
|
+
def use_now():
|
|
11
|
+
if self.Transparency<1.0:
|
|
12
|
+
self.Transparency+=0.01
|
|
13
|
+
self.root.attributes('-alpha',self.Transparency)
|
|
14
|
+
self.root.after(10,use_now)
|
|
15
|
+
elif self.Transparency>=1.0:
|
|
16
|
+
self.Transparency=1.0
|
|
17
|
+
self.root.attributes('-alpha',1)
|
|
18
|
+
use_now()
|
|
19
|
+
def Fade_out(self):
|
|
20
|
+
def see_now():
|
|
21
|
+
if self.out>=0:
|
|
22
|
+
self.out-=0.1
|
|
23
|
+
self.root.attributes('-alpha',self.out)
|
|
24
|
+
self.root.after(10,see_now)
|
|
25
|
+
else:
|
|
26
|
+
self.out=0
|
|
27
|
+
self.root.attributes('-alpha',0)
|
|
28
|
+
self.root.after(200, self.root.destroy)
|
|
29
|
+
see_now()
|
|
30
|
+
class NewButton(Weight):
|
|
31
|
+
def __init__(self,root,text,cmd,bg=None):
|
|
32
|
+
super().__init__(root,bg=bg)
|
|
33
|
+
self.text=text
|
|
34
|
+
self.cmd=cmd
|
|
35
|
+
def use(self):
|
|
36
|
+
self.weight=tk.Label(self.root,text=self.text,bg=self.bg)
|
|
37
|
+
self.weight.bind('<Button-1>',lambda events:self.cmd())
|
|
38
|
+
self.weight.pack()
|
|
39
|
+
def hover(self,hover_bg,leave_bg):
|
|
40
|
+
self.weight.bind('<Enter>',lambda events,c=self.weight:c.config(bg=hover_bg))
|
|
41
|
+
self.weight.bind('<Leave>',lambda events,c=self.weight:c.config(bg=leave_bg))
|
|
42
|
+
def main():
|
|
43
|
+
root=tk.Tk()
|
|
44
|
+
root.title('show')
|
|
45
|
+
root.geometry('300x300')
|
|
46
|
+
Weight(root).Fade_in()
|
|
47
|
+
btn1=NewButton(root,'Hello',lambda:Weight(root).Fade_out(),'red')
|
|
48
|
+
btn1.use()
|
|
49
|
+
btn1.hover('blue','red')
|
|
50
|
+
root.mainloop()
|
|
51
|
+
if __name__=='__main__':
|
|
52
|
+
main()
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: newtk
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: newtk is a modern, lightweight GUI enhancement library for Python's built-in `tkinter`.
|
|
5
|
+
Author-email: cjq <mycjq20111204@outlook.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Keywords: tkinter,gui,animation,ui,modern,hover-effects
|
|
8
|
+
Requires-Python: >=3.8
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Dynamic: license-file
|
|
12
|
+
|
|
13
|
+
#newtk
|
|
14
|
+
newtk is a modern, lightweight GUI enhancement library for Python's built-in `tkinter`. It is designed to bring sleek animations and interactive effects to your desktop applications with minimal code.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
newtk
|