Files
openide/python/helpers/pydev/pydev_tests_mainloop/gui-tk.py
Elizaveta Shashkova 626a14835a IDEA-CR-53093: PY-37226 Revert pydev prefix for test directories
GitOrigin-RevId: 3d4abb05167e85cb44720e36d0fa3b949f199f30
2019-10-08 12:33:08 +00:00

34 lines
762 B
Python

#!/usr/bin/env python
"""Simple Tk example to manually test event loop integration.
To run this:
1) Enable the PyDev GUI event loop integration for tk
2) do an execfile on this script
3) ensure you have a working GUI simultaneously with an
interactive console
"""
if __name__ == '__main__':
try:
from Tkinter import *
except:
# Python 3
from tkinter import *
class MyApp:
def __init__(self, root):
frame = Frame(root)
frame.pack()
self.button = Button(frame, text="Hello", command=self.hello_world)
self.button.pack(side=LEFT)
def hello_world(self):
print("Hello World!")
root = Tk()
app = MyApp(root)