def add(self, art, name=None, label=None, ui_class=None): self.tab_counter += 1 self.tabs += 1 if name == None: name = "sheet_{}".format(self.tab_counter) if label == None: label = "Sheet {}".format(self.tab_counter) tk = self.tk nb = self.notebook if not hasattr(art, "state_graphs"): art.state_graphs = [] tab = nb.add(name, label=label) pw = Tix.PanedWindow(tab, orientation="horizontal") pw.pack(fill=BOTH, expand=1) frame = pw.add("f1", min=50) state_frame = pw.add("f2", min=200) hbar = Scrollbar(frame, orient=HORIZONTAL) hbar.pack(side=BOTTOM, fill=X) vbar = Scrollbar(frame, orient=VERTICAL) vbar.pack(side=RIGHT, fill=Y) tk_ag_ui = self.wrap_art_ui(ui_class) if ui_class else self.analysisGraphWidgetClass gw = tk_ag_ui(tk, art, frame) gw.state_frame = state_frame gw.ui_parent = self gw.ui_tab_name = name hbar.config(command=gw.xview) vbar.config(command=gw.yview) gw.config(xscrollcommand=hbar.set, yscrollcommand=vbar.set) for sg in art.state_graphs: tk_graph_ui.show_graph(sg, tk, parent=gw, frame=state_frame, ui_parent=this) nb.raise_page(name) gw.start() return gw
def add(self,art,name=None,label=None): self.tab_counter += 1 self.tabs += 1 if name == None: name = "sheet_{}".format(self.tab_counter) if label == None: label = "Sheet {}".format(self.tab_counter) tk = self.tk nb = self.notebook if not hasattr(art,'state_graphs'): art.state_graphs = [] tab = nb.add(name,label=label) pw=Tix.PanedWindow(tab,orientation='horizontal') pw.pack(fill=BOTH,expand=1) frame=pw.add('f1') state_frame=pw.add('f2') hbar=Scrollbar(frame,orient=HORIZONTAL) hbar.pack(side=BOTTOM,fill=X) vbar=Scrollbar(frame,orient=VERTICAL) vbar.pack(side=RIGHT,fill=Y) gw = TkAnalysisGraphWidget(tk,art,frame) gw.state_frame=state_frame gw.ui_parent = self gw.ui_tab_name = name hbar.config(command=gw.xview) vbar.config(command=gw.yview) gw.config(xscrollcommand=hbar.set, yscrollcommand=vbar.set) for sg in art.state_graphs: tk_graph_ui.show_graph(sg,tk,parent=gw,frame=state_frame,ui_parent=this) nb.raise_page(name)
def add(self, art, name=None, label=None, ui_class=None): self.tab_counter += 1 self.tabs += 1 if name == None: name = "sheet_{}".format(self.tab_counter) if label == None: label = "Sheet {}".format(self.tab_counter) tk = self.tk nb = self.notebook if not hasattr(art, 'state_graphs'): art.state_graphs = [] tab = nb.add(name, label=label) pw = Tix.PanedWindow(tab, orientation='horizontal') pw.pack(fill=BOTH, expand=1) frame = pw.add('f1', min=50) state_frame = pw.add('f2', min=200) hbar = Scrollbar(frame, orient=HORIZONTAL) hbar.pack(side=BOTTOM, fill=X) vbar = Scrollbar(frame, orient=VERTICAL) vbar.pack(side=RIGHT, fill=Y) tk_ag_ui = self.wrap_art_ui( ui_class) if ui_class else self.analysisGraphWidgetClass gw = tk_ag_ui(tk, art, frame) gw.state_frame = state_frame gw.ui_parent = self gw.ui_tab_name = name hbar.config(command=gw.xview) vbar.config(command=gw.yview) gw.config(xscrollcommand=hbar.set, yscrollcommand=vbar.set) for sg in art.state_graphs: tk_graph_ui.show_graph(sg, tk, parent=gw, frame=state_frame, ui_parent=this) nb.raise_page(name) gw.start() return gw
def show_graph(self, sg): return tk_graph_ui.show_graph(sg, self.tk, parent=self, frame=self.state_frame, ui_parent=self.ui_parent)