def new_view(self, name): newview = serverView() newview.set_detach_handler(self.attach_detach) ## ## The initial tab that comes with the GtkNotebook creation seems to ## give too many problems. For example, it does not seem to be able ## to change the color of its label (a gtk bug?). Therefore this tab ## is immediately after creating the second tab (a GtkNotebook can't ## handle having 0 tabs very well). l = GtkLabel("tab %d" % self.count) l.set_name("label") container = GtkVBox() container.show() newview.nestTab(self.tabs, container, l) self.tabs.append_page(container, l) self.count = self.count + 1 ## ## The tabmap must contain newview, because the (possible) deletion of ## the first tab may cause switch_page to be invoked. self.tabmap[container] = newview if len(self.tabmap.keys()) == 1: self.tabs.remove_page(0) self.currentpage = newview newview.activate() serveritem = GtkTreeItem(name) servertree = GtkTree() self.tree.append(serveritem) serveritem.set_subtree(servertree) serveritem.show() serveritem.connect("button-press-event", self.tree_handler, self.count) # delegate subtree newview.set_tree(serveritem, servertree) return newview
def new_view(self, name): newview = serverView() newview.run() return newview
def new_view(self, name): newview = serverView() newview.start() return newview