Browse Source

更新 'tt.py'

hzhu 7 years ago
parent
commit
1dc15e47cc
1 changed files with 18 additions and 0 deletions
  1. 18 0
      tt.py

+ 18 - 0
tt.py

1
 from Tkinter import *
1
 from Tkinter import *
2
+def response(event):
3
+    I = event.widget['text']
4
+    
5
+    texts = UPN.text.get(1.0,END+'-1c')
6
+    #print texts
7
+
8
+    if I == 'DEL':
9
+        UPN.text.delete(INSERT + '-1c',INSERT)
10
+    elif I == 'Clear':
11
+        UPN.text.delete(1.0,END)
12
+    elif I == 'Enter':
13
+        PolishStyleGui.text.insert(INSERT,'\n')
14
+    elif I == '=':
15
+        s = toList(texts)
16
+        #print s
17
+        UPN.text.insert(END,'\n=\n')
18
+        UPN.text.insert(END,suffixPolishStyle(s))
19
+        UPN.text.see('end')
2
 def UPN():    
20
 def UPN():    
3
     root.title('umgekehrte polnische Notation')
21
     root.title('umgekehrte polnische Notation')
4
     root.resizable(False,False)
22
     root.resizable(False,False)