Skip to content

Commit

Permalink
Merge pull request #1249 from dlakaplan/addzoomstatus
Browse files Browse the repository at this point in the history
PINTk improvements
  • Loading branch information
scottransom authored May 25, 2022
2 parents 08d1c9a + 665a305 commit cf4d851
Show file tree
Hide file tree
Showing 5 changed files with 212 additions and 32 deletions.
57 changes: 50 additions & 7 deletions src/pint/pintk/paredit.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import pint.logging
from loguru import logger as log
import pint.pintk.plk


class ParChoiceWidget(tk.Frame):
Expand All @@ -19,6 +20,7 @@ class ParChoiceWidget(tk.Frame):

def __init__(self, master=None):
tk.Frame.__init__(self, master)
self.configure(bg=pint.pintk.plk.background)

self.choose_callback = None
self.initLayout()
Expand All @@ -31,6 +33,8 @@ def initLayout(self):
command=self.choose,
variable=self.choice,
value="prefit",
bg=pint.pintk.plk.background,
fg=pint.pintk.plk.foreground,
)
self.prefit.select()
self.prefit.grid(row=0, column=0)
Expand All @@ -41,6 +45,8 @@ def initLayout(self):
command=self.choose,
variable=self.choice,
value="postfit",
bg=pint.pintk.plk.background,
fg=pint.pintk.plk.foreground,
)
self.postfit.grid(row=0, column=1)

Expand All @@ -58,6 +64,7 @@ class ParActionsWidget(tk.Frame):

def __init__(self, master=None):
tk.Frame.__init__(self, master)
self.configure(bg=pint.pintk.plk.background)

self.reset_callback = None
self.remove_callback = None
Expand All @@ -70,25 +77,60 @@ def __init__(self, master=None):
self.initLayout()

def initLayout(self):
button = tk.Button(self, text="Reset Model", command=self.resetParfile)
button = tk.Button(
self,
text="Reset Model",
command=self.resetParfile,
fg=pint.pintk.plk.foreground,
)
button.grid(row=0, column=0)

button = tk.Button(self, text="Remove Changes", command=self.removeChanges)
button = tk.Button(
self,
text="Remove Changes",
command=self.removeChanges,
fg=pint.pintk.plk.foreground,
)
button.grid(row=0, column=1)

button = tk.Button(self, text="Apply Changes", command=self.applyChanges)
button = tk.Button(
self,
text="Apply Changes",
command=self.applyChanges,
fg=pint.pintk.plk.foreground,
)
button.grid(row=0, column=2)

button = tk.Button(self, text="Write Par", command=self.writePar)
button = tk.Button(
self,
text="Write Par",
command=self.writePar,
fg=pint.pintk.plk.foreground,
)
button.grid(row=0, column=3)

button = tk.Button(self, text="Center PEPOCH", command=self.centerPEPOCH)
button = tk.Button(
self,
text="Center PEPOCH",
command=self.centerPEPOCH,
fg=pint.pintk.plk.foreground,
)
button.grid(row=0, column=4)

button = tk.Button(self, text="Center POSEPOCH", command=self.centerPOSEPOCH)
button = tk.Button(
self,
text="Center POSEPOCH",
command=self.centerPOSEPOCH,
fg=pint.pintk.plk.foreground,
)
button.grid(row=1, column=1)

button = tk.Button(self, text="Center T0", command=self.centerT0)
button = tk.Button(
self,
text="Center T0",
command=self.centerT0,
fg=pint.pintk.plk.foreground,
)
button.grid(row=1, column=2)

def setCallbacks(
Expand Down Expand Up @@ -152,6 +194,7 @@ class ParWidget(tk.Frame):

def __init__(self, master=None):
tk.Frame.__init__(self, master)
self.configure(bg=pint.pintk.plk.background)

self.psr = None
self.update_callbacks = None
Expand Down
Loading

0 comments on commit cf4d851

Please sign in to comment.