Exemple #1
0
    def __init__(self, master=None, width=1100, height=600):

        Frame.__init__(self, master, width=1100, height=600)
        self.grid(sticky=N + E + S + W)

        self.wfm = None
        self.view = None

        top = self.winfo_toplevel()
        top.rowconfigure(0, weight=1)
        top.columnconfigure(0, weight=1)

        self.menu_bar = Menu(top, tearoff=0)
        top["menu"] = self.menu_bar
        self.__initFileMenu()
        self.__initViewMenu()
        self.__initAlgorithmsMenu()
        self.file_menu.add_command(label="Exit", command=top.quit)

        # Layout
        self.rowconfigure(0, weight=1)
        self.rowconfigure(1, weight=1)
        self.columnconfigure(0, weight=1, minsize=30)
        self.columnconfigure(1, weight=4, minsize=500)
        self.columnconfigure(2, weight=4)

        # Create main widgets
        self.info_panel = WfMultiListbox(self,
                                         (('Attribute', 12), ('Value', 20)))
        self.info_panel.grid(row=0, column=0, rowspan=2, sticky=N + S + E + W)

        self.model_canvas = WfCanvas(self)
        self.model_canvas.grid(row=0, column=1, sticky=N + S + E + W)

        layoutMan = WfElasticLayout(maxx=1280,
                                    maxy=768,
                                    actwidth=20,
                                    actheight=20)
        self.model_canvas.setLayout(layoutMan)

        self.view_canvas = WfCanvas(self, ctype="VIEW")
        layoutView = WfElasticLayout(maxx=1280,
                                     maxy=768,
                                     actwidth=20,
                                     actheight=20)
        self.view_canvas.setLayout(layoutView)
        self.view_canvas.grid_remove()