-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbutton.py
More file actions
28 lines (21 loc) · 763 Bytes
/
button.py
File metadata and controls
28 lines (21 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from tkinter import *
from .widgetBase import *
class ButtonOBJ(widget):
def setOnClick(self, addr):
self.attributes["onClick"] = addr
def draw(self):
#try:
#print(getattr(self.window, self.attributes["onClick"]))
obj = Button(self.window, text=self.attributes["text"], command=getattr(self.winOBJ, self.attributes["onClick"]))#getattr(self.callsClass, self.attributes["onClick"]))
obj.pack()
self.obj = obj
return obj, self.window
#except Exception as e:
#print(e)
obj = Button(self.window, text=self.attributes["text"])
obj.pack()
self.obj = obj
return obj, self.window
#else:
raise Exception("An Error Occured")
pass