CTkPlus 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.
- ctkplus-0.1.0/CTkPlus/CTkPlus.py +65 -0
- ctkplus-0.1.0/CTkPlus/__init__.py +1 -0
- ctkplus-0.1.0/CTkPlus.egg-info/PKG-INFO +5 -0
- ctkplus-0.1.0/CTkPlus.egg-info/SOURCES.txt +8 -0
- ctkplus-0.1.0/CTkPlus.egg-info/dependency_links.txt +1 -0
- ctkplus-0.1.0/CTkPlus.egg-info/requires.txt +1 -0
- ctkplus-0.1.0/CTkPlus.egg-info/top_level.txt +1 -0
- ctkplus-0.1.0/PKG-INFO +5 -0
- ctkplus-0.1.0/pyproject.toml +11 -0
- ctkplus-0.1.0/setup.cfg +4 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import customtkinter as tk
|
|
2
|
+
|
|
3
|
+
class CTkEntryButton(tk.CTkFrame):
|
|
4
|
+
def __init__(self, master, command=None, text='✔️', placeholder_text=None, bg_color="transparent", fg_color="transparent", **kwargs):
|
|
5
|
+
super().__init__(master, bg_color=bg_color,fg_color=fg_color, **kwargs)
|
|
6
|
+
|
|
7
|
+
self.entry = tk.CTkEntry(self, placeholder_text=placeholder_text)
|
|
8
|
+
self.entry.pack(side='left')
|
|
9
|
+
|
|
10
|
+
self.button = tk.CTkButton(self,width=5,text=text,font=('Classic',15),command=command)
|
|
11
|
+
self.button.pack(padx=2,side='left')
|
|
12
|
+
|
|
13
|
+
def get(self):
|
|
14
|
+
return self.entry.get()
|
|
15
|
+
|
|
16
|
+
class CTkSpinBox(tk.CTkFrame):
|
|
17
|
+
def __init__(self, master,command=lambda *args: None,start_num=0,bg_color="transparent", fg_color="transparent", **kwargs):
|
|
18
|
+
super().__init__(master,bg_color=bg_color,fg_color=fg_color)
|
|
19
|
+
|
|
20
|
+
self.string = tk.StringVar()
|
|
21
|
+
self.string.trace_add('write',command)
|
|
22
|
+
|
|
23
|
+
self.entry = tk.CTkEntry(self,textvariable=self.string,corner_radius=0)
|
|
24
|
+
self.entry.pack(side='left')
|
|
25
|
+
self.entry.insert(0,str(start_num))
|
|
26
|
+
|
|
27
|
+
self.frame = tk.CTkFrame(self)
|
|
28
|
+
self.frame.pack(side='left')
|
|
29
|
+
|
|
30
|
+
self.button = tk.CTkButton(self.frame,width=15,height=14,text='▲',font=('Impact',5,'bold'),corner_radius=0,command=lambda: self.plus(1))
|
|
31
|
+
self.button.pack(side='top',pady=0)
|
|
32
|
+
|
|
33
|
+
self.button2 = tk.CTkButton(self.frame,width=15,height=14,text='▼',font=('Impact',5,'bold'),corner_radius=0,command=lambda: self.minus(1))
|
|
34
|
+
self.button2.pack(side='bottom',pady=0)
|
|
35
|
+
|
|
36
|
+
def plus(self,*args):
|
|
37
|
+
try:
|
|
38
|
+
r = self.entry.get()
|
|
39
|
+
self.entry.delete(0,tk.END)
|
|
40
|
+
self.entry.insert(0,str(int(r)+sum(args)))
|
|
41
|
+
return self.entry.get()
|
|
42
|
+
except:
|
|
43
|
+
pass
|
|
44
|
+
|
|
45
|
+
def minus(self, *args):
|
|
46
|
+
try:
|
|
47
|
+
r = self.entry.get()
|
|
48
|
+
if int(r) != 0:
|
|
49
|
+
self.entry.delete(0,tk.END)
|
|
50
|
+
self.entry.insert(0,str(int(r)-sum(args)))
|
|
51
|
+
return self.entry.get()
|
|
52
|
+
except:
|
|
53
|
+
pass
|
|
54
|
+
|
|
55
|
+
def get(self):
|
|
56
|
+
return self.entry.get()
|
|
57
|
+
|
|
58
|
+
class CTkEntry(tk.CTkEntry):
|
|
59
|
+
def __init__(self, master, width = 140, height = 28, corner_radius = None, border_width = None, bg_color = "transparent", fg_color = None, border_color = None, text_color = None, placeholder_text_color = None, textvariable = None, placeholder_text = None, font = None, command=lambda *args: None, **kwargs):
|
|
60
|
+
super().__init__(master, width, height, corner_radius, border_width, bg_color, fg_color, border_color, text_color, placeholder_text_color, textvariable, placeholder_text, font, **kwargs)
|
|
61
|
+
|
|
62
|
+
self.string = tk.StringVar()
|
|
63
|
+
self.string.trace_add('write',command)
|
|
64
|
+
self.configure(textvariable=self.string)
|
|
65
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .CTkPlus import CTkEntryButton, CTkSpinBox, CTkEntry
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
customtkinter
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
CTkPlus
|
ctkplus-0.1.0/PKG-INFO
ADDED
ctkplus-0.1.0/setup.cfg
ADDED