repl.it
@paulfears/

greyscale

Tkinter

No description

fork
loading
Files
  • main.py
  • cat.jpg
  • graphics.py
  • kitty.png
  • negitive_kitty.png
  • nohup.out
  • savekat.png
main.py
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
29
30
31
32
33
34
35
36
#escape_input.py
#does the other stuff but can now escape escape_input
__author__ = 'paul fears'
__date__ = '12/4/2019'
from graphics import *


def handleClick(pt, win):
  # create an Entry for user to type in
  entry = Entry(pt, 10)
  entry.draw(win)
  # Go modal: loop until user types <Enter> key
  while True:
    key = win.getKey()
    if key== "Return": break
    if key == "Escape":break
    # undraw the entry and create and draw TextO
  entry.undraw()
  if(key == 'Return'):
    typed = entry.getText()
    Text(pt, typed).draw(win)
  if(key == 'Escape'):
    print('escape pressed')
  # clear (ignore) any mouse click that occurred during text entry
  win.checkMouse() 

def main():
  win = GraphWin("entry", 500, 500)
  while True:
    pt = win.checkMouse()
    if pt:
      handleClick(pt, win)

if __name__ == '__main__':
  main()
?