diff --git a/copycat/gui/control.py b/copycat/gui/control.py index 1c1e1a1..04dc43d 100644 --- a/copycat/gui/control.py +++ b/copycat/gui/control.py @@ -12,16 +12,16 @@ class Control(GridFrame): self.steps = 0 self.go = False - self.playbutton = tk.Button(self, bd=0, text='Play', command=lambda : self.toggle(), background='black', foreground='white', activebackground='black', activeforeground='blue') + self.playbutton = ttk.Button(self, text='Play', command=lambda : self.toggle()) self.add(self.playbutton, 0, 0) - self.stepbutton = tk.Button(self, bd=0, text='Step', command=lambda : self.step(), background='black', foreground='white', activebackground='black', activeforeground='blue') + self.stepbutton = ttk.Button(self, text='Step', command=lambda : self.step()) self.add(self.stepbutton, 1, 0) self.entry = Entry(self) self.add(self.entry, 0, 1, xspan=2) - self.gobutton = tk.Button(self, bd=0, text='Go', command=lambda : self.set_go(), background='black', foreground='white', activebackground='black', activeforeground='blue') + self.gobutton = ttk.Button(self, text='Go', command=lambda : self.set_go()) self.add(self.gobutton, 0, 2, xspan=2) def play(self): diff --git a/copycat/gui/entry.py b/copycat/gui/entry.py index 556a3f0..a8e9d53 100644 --- a/copycat/gui/entry.py +++ b/copycat/gui/entry.py @@ -4,25 +4,23 @@ import tkinter.ttk as ttk from .gridframe import GridFrame -style = dict(background='black', foreground='white') - class Entry(GridFrame): def __init__(self, parent, *args, **kwargs): GridFrame.__init__(self, parent, *args, **kwargs) - self.aLabel = tk.Label(self, text='Initial:', **style) - self.a = tk.Entry(self, **style) + self.aLabel = ttk.Label(self, text='Initial:') + self.a = ttk.Entry(self) self.add(self.aLabel, 0, 0) self.add(self.a, 0, 1) - self.bLabel = tk.Label(self, text='Final:', **style) - self.b = tk.Entry(self, **style) + self.bLabel = ttk.Label(self, text='Final:') + self.b = ttk.Entry(self) self.add(self.bLabel, 1, 0) self.add(self.b, 1, 1) - self.cLabel = tk.Label(self, text='Next:', **style) - self.c = tk.Entry(self, **style) + self.cLabel = ttk.Label(self, text='Next:') + self.c = ttk.Entry(self) self.add(self.cLabel, 2, 0) self.add(self.c, 2, 1) diff --git a/copycat/gui/gridframe.py b/copycat/gui/gridframe.py index d5218b9..45db07d 100644 --- a/copycat/gui/gridframe.py +++ b/copycat/gui/gridframe.py @@ -3,7 +3,7 @@ import tkinter.ttk as ttk class GridFrame(tk.Frame): def __init__(self, parent, *args, **kwargs): - tk.Frame.__init__(self, parent, *args, **kwargs, bd=0) + ttk.Frame.__init__(self, parent, *args, **kwargs) def add(self, element, x, y, xspan=1, yspan=1): element.grid(column=x, row=y, columnspan=xspan, rowspan=yspan, sticky=tk.N+tk.E+tk.S+tk.W) diff --git a/copycat/gui/list.py b/copycat/gui/list.py index 1b73148..0c6ffb0 100644 --- a/copycat/gui/list.py +++ b/copycat/gui/list.py @@ -1,4 +1,5 @@ import tkinter as tk +import tkinter.ttk as ttk import time @@ -8,7 +9,7 @@ class List(GridFrame): def __init__(self, parent, columns, updateInterval=.1, **style): GridFrame.__init__(self, parent) - self.text = tk.Label(self, **style, anchor='w', justify=tk.LEFT, width=30) + self.text = ttk.Label(self, anchor='w', justify=tk.LEFT, width=30) self.add(self.text, 0, 0) self.columns = columns diff --git a/copycat/gui/status.py b/copycat/gui/status.py index e54e479..9b5363a 100644 --- a/copycat/gui/status.py +++ b/copycat/gui/status.py @@ -49,18 +49,3 @@ class Status(object): def update_plots(self, i): self.subplot.clear() self.modifier(self) - -if __name__ == '__main__': - app = tk.Tk() - status = Status() - sframe = StatusFrame(app, status, 'x**2') - sframe.pack() - - i = 0 - while True: - app.update() - app.update_idletasks() - time.sleep(.01) - i += 1 - status.x += [i] - status.y += [i**2]