Ejemplo n.º 1
0
    def __init__(self, master):
        """
        This is the highest class in the hierarchy. It maintains a reference to the
        main data structure that this GUI is manipulating. All other classes keep a reference to
        their parent and can access the Truss via this class.
        """
        self.master = master

        # Instantiate data structure
        self.truss = Truss()

        # Graphics
        self.frame = Frame(master, width=WINDOW_WIDTH, height=WINDOW_HEIGHT)
        self.designSpace = DesignSpace(self)
        #self.infoPane = InfoPane(self)
        self.toolbar = Toolbar(self)

        # Menu
        TopMenu(self)

        # Display
        self.toolbar.frame.grid(row=0, column=0)
        self.frame.pack()

        # Event Binding
        root.bind("<Control-g>", self.designSpace.toggleSnap)

        # Current filename
        self.fileName = None