import _thread as thread import time import copy from collections import OrderedDict import tkinter tk = tkinter from idlelib.tooltip import Hovertip import tkgui.dialog as dialoglib dialog = dialoglib.Dialog() import __main__ as MAIN from lib.cprint import * import lib.mytklib as mytklib import lib.fixlib as fixlib import lib.showlib as showlib import lib.libtk as libtk import lib.tkevent as tkevent class LOAD_FIXTURE(): def __init__(self,parent=None,name=""): self.name=name self.master = None self.parent=parent #self.x = _LOAD_FIXTURE(parent,name) #self.cb = self.x.cb def cb(self,event=None,fixture={}): print("LOAD_FIXTURE",self.name,event) print(self,"cb") self.parent.clear() if fixture: print(len(fixture)) self.parent.load(fixture) class TableFrame(): def __init__(self,root, width=50,height=100,bd=1): self.root=root self.a = _TableFrame(self.root) f=self.a.HFrame() f=self.a.Sframe(f, width=width,height=height,bd=bd) self.a.draw([["A","11"],["B",4],["E",""],["R","R"],["Z","Z"],["U","U"]]) self.b = _TableFrame(self.root) #äself.root) b=self.b.HFrame() b=self.b.Sframe(b, width=width,height=height,bd=bd) self.b.draw([["AA","1a1"],["BBB",114],["EE","22"],["RRR","RRR"],["TTZ","TTZ"],["ZZU","ZZU"]]) self.c = _TableFrame(self.root) c=self.c.HFrame() c=self.c.Sframe(c, width=width,height=height,bd=bd) self.c.draw([["A","11"],["B",4],["E",""],["R","R"],["Z","Z"],["U","U"]][::-1]) self.bframe=None def draw(self,data=[1,2],head=[],config=[]): pass class _TableFrame(): def __init__(self,main): self.main = main self.frame=tk.Frame(self.main,relief=tk.GROOVE,bg="yellow")#,width=width,height=height,bd=bd) self.frame.pack(side="top",fill="x",expand=1) #x=0,y=0) self.hframe=tk.Frame(self.frame,relief=tk.GROOVE,bg="yellow")#,width=width,height=height,bd=bd) self.hframe.pack(side="top",fill="x",expand=0) #x=0,y=0) self.aframe=tk.Frame(self.main,relief=tk.GROOVE)#,width=width,height=height,bd=bd) #aframe.place(x=0,y=0) self.aframe.pack(side="top",fill="both",expand=1) #x=0,y=0) self.canvas=tk.Canvas(self.aframe,width=100-24,height=150) self.canvas["bg"] = "blue" #black" #"green" self.bframe=tk.Frame(self.canvas)#,width=width,height=height) self.bframe["bg"] = "blue" self.scrollbar=tk.Scrollbar(self.aframe,orient="vertical",command=self.canvas.yview,width=20) self.canvas.configure(yscrollcommand=self.scrollbar.set) self.scrollbar.pack(side="right",fill="y") self.canvas.pack(side="left",expand=1,fill="both") self.canvas.create_window((0,0),window=self.bframe,anchor='nw') self.bframe.bind("",scroll(self.canvas).config) self.canvas.bind("