Test Connection Treeview bcollect.invoke()
This commit is contained in:
parent
b348eee285
commit
abaa18e3b4
@ -77,9 +77,6 @@ class buildpanel(tk.Frame):
|
||||
self.updateplotfields(update_row, CCDplot)
|
||||
#
|
||||
self.jf = JFSphoto
|
||||
|
||||
|
||||
|
||||
self.jfsAddOns(CCDplot)
|
||||
|
||||
|
||||
@ -335,7 +332,7 @@ class buildpanel(tk.Frame):
|
||||
self.jfspkine2 = tk.Entry(self.jfslf1,textvariable=kin_repeats,width=4)
|
||||
self.jfspkine2.grid(row=1,column=1,sticky='e')
|
||||
|
||||
self.jfspdmath = tk.Button(self,text='Math..',fg="blue", command=self.jf.do_math)
|
||||
self.jfspdmath = tk.Button(self,text='Math..',fg="blue", command=lambda JFSphoto=Jfsphoto: self.jf.do_math(self))
|
||||
self.jfspdmath.grid(row=save_row,column=4,sticky='e',padx=4)
|
||||
|
||||
### Reset changes from loading phometerfile
|
||||
|
||||
46
JFSphoto.py
46
JFSphoto.py
@ -19,7 +19,8 @@ import time
|
||||
from matplotlib import cm
|
||||
from matplotlib.ticker import LinearLocator, FormatStrFormatter
|
||||
from mpl_toolkits.mplot3d import Axes3D
|
||||
|
||||
from tkinter import ttk
|
||||
import CCDpanelsetup as panel
|
||||
####################################### object
|
||||
|
||||
class Jfsphoto (object):
|
||||
@ -311,7 +312,9 @@ class Jfsphoto (object):
|
||||
print("By the great otter!","No config.ini file")
|
||||
|
||||
|
||||
def do_math(self):
|
||||
def do_math(self,panel):
|
||||
print(panel.SHvalue.get())
|
||||
panel.bcollect.invoke()
|
||||
stati = [("Raw",1),("Raw + Baseline",2),("Transmission",4),("Absorbanz",3)]
|
||||
def toggle():
|
||||
if self.kbtn.config('relief')[-1] == 'sunken':
|
||||
@ -353,7 +356,8 @@ class Jfsphoto (object):
|
||||
self.kbtn.grid(row=16,column=0,sticky="w")
|
||||
self.kbtn = tk.Button(master=self.ctr_right,text="3 D Print",command=toggle,width=15,relief='raised')
|
||||
self.kbtn.grid(row=17,column=0,sticky="w")
|
||||
|
||||
self.kbtm = tk.Button(master=self.ctr_right,text="Methods",command=lambda JFSphoto=Jfsphoto: self.do_methods(panel),width=15)
|
||||
self.kbtm.grid(row=18,column=0,sticky="w")
|
||||
if self.calculate() :
|
||||
self.show_first_look()
|
||||
else:
|
||||
@ -478,4 +482,38 @@ class Jfsphoto (object):
|
||||
t = arange(0.0, 3.0, 0.01)
|
||||
s = sin(2*pi*t)
|
||||
self.ax1.plot(t, s, linewidth=0.6)
|
||||
self.canvas.draw()
|
||||
self.canvas.draw()
|
||||
|
||||
def do_methods(self,panel):
|
||||
print(panel.SHvalue.get())
|
||||
win = tk.Toplevel()
|
||||
tree = ttk.Treeview(win,selectmode='browse')
|
||||
tree.grid()
|
||||
|
||||
def cb(event):
|
||||
print(tree.selection())
|
||||
panel.bcollect.invoke()
|
||||
|
||||
#tree.tag_bind('cb','<1>',cb)
|
||||
tree.tag_bind('cb','<<TreeviewSelect>>',cb)
|
||||
#tree.tag_bind('cb', '<<TreeviewOpen>>', cb)
|
||||
#tree.tag_bind('cb', '<<TreeviewClose>>', cb)
|
||||
|
||||
|
||||
|
||||
tree.insert('', 'end', 'widgets', text='Widgets',tags=('cb'))
|
||||
tree.insert('', 0, 'apps', text='Applications',tags=('cb'))
|
||||
|
||||
tree['columns'] = ('size', 'modified')
|
||||
tree.column('size', width=50, anchor='center')
|
||||
tree.heading('size', text='Size')
|
||||
tree.heading('modified', text='Modified')
|
||||
|
||||
tree.set('widgets', 'size', '12KB')
|
||||
tree.set('widgets', 'modified', 'Last week')
|
||||
|
||||
tree.insert('', 'end', text='Canvas', values=('25KB Today'),tags=('cb'))
|
||||
tree.insert('apps', 'end', text='Browser', values=('115KB Yesterday'),tags=('cb'))
|
||||
win.focus_set()
|
||||
win.grab_set()
|
||||
win.wait_window()
|
||||
@ -3,15 +3,16 @@ from tkinter import ttk
|
||||
|
||||
root = tk.Tk()
|
||||
|
||||
tree = ttk.Treeview(root)
|
||||
tree = ttk.Treeview(root,selectmode='browse')
|
||||
tree.grid()
|
||||
|
||||
def cb(event):
|
||||
print(event, tree.selection(), tree.focus())
|
||||
print(tree.selection())
|
||||
|
||||
tree.tag_bind('cb','<1>',cb)
|
||||
tree.tag_bind('cb','<<TreeviewSelect>>',cb)
|
||||
tree.tag_bind('cb', '<<TreeviewOpen>>', cb)
|
||||
tree.tag_bind('cb', '<<TreeviewClose>>', cb)
|
||||
#tree.tag_bind('cb', '<<TreeviewOpen>>', cb)
|
||||
#tree.tag_bind('cb', '<<TreeviewClose>>', cb)
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user