diff --git a/CCDpanelsetup.py b/CCDpanelsetup.py index 13ef5bf..0ac2816 100644 --- a/CCDpanelsetup.py +++ b/CCDpanelsetup.py @@ -304,11 +304,11 @@ class buildpanel(tk.Frame): self.jfs4calhp.grid(row=device_row+1,column=5,sticky='e',padx=4) self.jfs4nm_check = tk.Checkbutton(self,text="[nm] scale on/off",variable=self.jf.nm_checked,command=lambda CCDplot=CCDplot: self.updateplot(CCDplot)) self.jfs4nm_check.grid(row=shicg_row-1,column=4,sticky='w',padx=4) - self.jfsdark = tk.Button(self,text='save Darkline',fg="blue", command= darkline) + self.jfsdark = tk.Button(self,text='save Dark',image=self.jf.bulbOff,compound=tk.LEFT,fg="blue", command= darkline) self.jfsdark.grid(row=shicg_row,column=4,sticky='e',padx=4) self.jfsdark_check = tk.Checkbutton(self,text="Darkline on/off",variable=self.jf.darkline_checked,state=tk.DISABLED,command=lambda CCDplot=CCDplot: self.updateplot(CCDplot)) self.jfsdark_check.grid(row=shicg_row+1,column=4,sticky='w') - self.jfsbase = tk.Button(self,text='save Baseline',fg="blue", command= baseline) + self.jfsbase = tk.Button(self,text='save Base',image=self.jf.bulbOn,compound=tk.LEFT,fg="blue", command= baseline) self.jfsbase.grid(row=shicg_row+2,column=4,sticky='e',padx=4) self.jfsbase_check = tk.Checkbutton(self,text="Baseline on/off",variable=self.jf.baseline_checked,state=tk.DISABLED,command=lambda CCDplot=CCDplot: self.updateplot(CCDplot)) self.jfsbase_check.grid(row=shicg_row+3,column=4,sticky='w') diff --git a/JFShelp.py b/JFShelp.py index 614c5f8..1583376 100644 --- a/JFShelp.py +++ b/JFShelp.py @@ -43,15 +43,16 @@ def center_window(size, window) : return - +def get_icon_image(xx): + directory_path = os.path.dirname(__file__) + file_path = os.path.join(directory_path, 'images\\') + image =Image.open(file_path+xx) + photo = ImageTk.PhotoImage(image) + return photo def jfshelpme(win,helpfor): - #### this is where we store the pictures etc - directory_path = os.path.dirname(__file__) - file_path = os.path.join(directory_path, 'images\\') - top = tk.Toplevel(win) scrolling = tk.Scrollbar(top) scrolling.pack(side=tk.RIGHT, fill=tk.Y) @@ -63,14 +64,10 @@ def jfshelpme(win,helpfor): scrolling.config(command=text.yview) text.config(yscrollcommand=scrolling.set) - image1 = Image.open(file_path+'nm405.gif') - photoImg = ImageTk.PhotoImage(image1) - image2 = Image.open(file_path+'methods.gif') - photoImg2= ImageTk.PhotoImage(image2) - image3 = Image.open(file_path+'kinetics.gif') - photoImg3= ImageTk.PhotoImage(image3) - image4 = Image.open(file_path+'xenon.gif') - photoImg4= ImageTk.PhotoImage(image4) + photoImg = get_icon_image('nm405.gif') + photoImg2= get_icon_image('methods.gif') + photoImg3= get_icon_image('kinetics.gif') + photoImg4= get_icon_image('xenon.gif') text.tag_configure('it', font=('Arial', 10, 'italic')) text.tag_configure('h1', font=('Verdana', 16, 'bold')) diff --git a/JFSphoto.py b/JFSphoto.py index 55b8695..9df9e95 100644 --- a/JFSphoto.py +++ b/JFSphoto.py @@ -130,7 +130,9 @@ class Jfsphoto (object): self.log = True ######### jfs methods self.methods = [] - + ######### get icons + self.bulbOn = get_icon_image('bulb-on.jpg') + self.bulbOff = get_icon_image('bulb-off.jpg') def do_calibrate(self): win = tk.Toplevel() diff --git a/images/bulb-off.jpg b/images/bulb-off.jpg new file mode 100644 index 0000000..9b855a3 Binary files /dev/null and b/images/bulb-off.jpg differ diff --git a/images/bulb-on.jpg b/images/bulb-on.jpg new file mode 100644 index 0000000..e9d4635 Binary files /dev/null and b/images/bulb-on.jpg differ