-
Notifications
You must be signed in to change notification settings - Fork 1
/
PyGeoGebra.py
49 lines (35 loc) · 1.51 KB
/
PyGeoGebra.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
37
38
39
40
41
42
43
44
45
46
47
48
49
from tkinter import Toplevel
import matplotlib
from matplotlib.backends._backend_tk import NavigationToolbar2Tk
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
import config
from config import *
# refactor
from functions import *
config.root = tk.Tk()
# create a new figure and axis
config.fig, config.ax = plt.subplots()
# plt.gcf().set_visible(False)
# config.fig.withdraw()
config.buttons_panel = tk.Frame(root)
# config.algorithms_panel = tk.Frame(root)
init_program()
config.canvas = FigureCanvasTkAgg(config.fig, master=root)
config.canvas.get_tk_widget().pack(side=tk.RIGHT, fill=tk.BOTH, expand=True)
config.toolbar = NavigationToolbar2Tk(config.canvas, config.root)
config.toolbar.update()
config.shapes = []
config.label_widgets = []
create_buttons()
config.side_panel = SidePanel(config.root, True, tk.LEFT, True)
config.side_panel.pack(side=tk.LEFT, fill=tk.BOTH, expand=True)
config.label_widget = tk.Label(config.side_panel.text, text="Algebra ", bg="white", font='Helvetica 18 bold underline')
config.label_widget.pack(anchor='w')
config.press_cid = config.ax.figure.canvas.mpl_connect('button_press_event', on_press)
config.release_cid = config.ax.figure.canvas.mpl_connect('button_release_event', on_release)
config.motion_cid = config.ax.figure.canvas.mpl_connect('motion_notify_event', on_motion)
config.ax.figure.canvas.mpl_connect('scroll_event', on_scroll)
config.ax.figure.canvas.mpl_connect('key_press_event', on_key)
config.root.protocol("WM_DELETE_WINDOW", on_closing)
update_display()
run()