def run(self, tk): root = tk.root() root.setLayout(TabbedLayout()) self.controls_panel = Panel(tk) self.controls_panel.setLayout(TabbedLayout()) self.advanced_panel = Panel(tk) self.advanced_panel.setLayout(TabbedLayout()) self.layouts_panel = Panel(tk) self.layouts_panel.setLayout(TabbedLayout()) self.events_panel = Panel(tk) self.events_panel.setLayout(TabbedLayout()) self.xml_panel = Panel(tk) self.xml_panel.setLayout(TabbedLayout()) self.apps_panel = Panel(tk) self.apps_panel.setLayout(TabbedLayout()) self.mysource = Panel(tk, scrolling=True) root.append(self.controls_panel, title="Simple Controls") root.append(self.advanced_panel, title="Advanced Controls") root.append(self.layouts_panel, title="Layouts") root.append(self.events_panel, title="Events") root.append(self.xml_panel, title="XML") root.append(self.apps_panel, title="Apps") root.append(self.mysource, title="My Source") self.build_simple_controls(self.controls_panel, tk) self.build_advanced_controls(self.advanced_panel, tk) self.build_layouts(self.layouts_panel, tk) self.build_events(self.events_panel, tk) self.build_xml(self.xml_panel, tk) self.build_apps(self.apps_panel, tk) mysource = open(make_py(__file__), "r").read() self.mysource.append(StaticHTMLText(tk,highlight(mysource))) root.layout()
def load_source(self, klass): mod = sys.modules[klass.__module__] sourcecode = open(make_py(mod.__file__), "r").read() return highlight(sourcecode)
def load_source(self, name): mod = __import__(name, globals(), locals(), []) #, -1) sourcecode = open(make_py(mod.__file__), "r").read() return highlight(sourcecode)