コード例 #1
0
    def _setup_global_file_tree(self):

        self.global_file_tree_frame = tk.Frame(self.content)
        self.global_file_tree_frame.grid(column=0,
                                         row=0,
                                         sticky=(tk.N, tk.S, tk.E, tk.W))
        self.tree_notebook.add(self.global_file_tree_frame, text='Global')

        self.global_file_tree = FileView(self.global_file_tree_frame,
                                         normalizer=self.filename_normalizer)
        self.global_file_tree.grid(column=0,
                                   row=0,
                                   sticky=(tk.N, tk.S, tk.E, tk.W))

        # # The tree's vertical scrollbar
        self.global_file_tree_scrollbar = tk.Scrollbar(
            self.global_file_tree_frame, orient=tk.VERTICAL)
        self.global_file_tree_scrollbar.grid(column=1,
                                             row=0,
                                             sticky=(tk.N, tk.S))

        # # Tie the scrollbar to the text views, and the text views
        # # to each other.
        self.global_file_tree.config(
            yscrollcommand=self.global_file_tree_scrollbar.set)
        self.global_file_tree_scrollbar.config(
            command=self.global_file_tree.yview)

        # Setup weights for the "global_file_tree" tree
        self.global_file_tree_frame.columnconfigure(0, weight=1)
        self.global_file_tree_frame.columnconfigure(1, weight=0)
        self.global_file_tree_frame.rowconfigure(0, weight=1)

        # Handlers for GUI events
        self.global_file_tree.bind('<<TreeviewSelect>>', self.on_file_selected)
コード例 #2
0
ファイル: view.py プロジェクト: doismellburning/duvet
    def _setup_project_file_tree(self):

        self.project_file_tree_frame = Frame(self.content)
        self.project_file_tree_frame.grid(column=0, row=0, sticky=(N, S, E, W))
        self.tree_notebook.add(self.project_file_tree_frame, text='Project')

        self.project_file_tree = FileView(self.project_file_tree_frame, normalizer=self.filename_normalizer, root=self.base_path)
        self.project_file_tree.grid(column=0, row=0, sticky=(N, S, E, W))

        # # The tree's vertical scrollbar
        self.project_file_tree_scrollbar = Scrollbar(self.project_file_tree_frame, orient=VERTICAL)
        self.project_file_tree_scrollbar.grid(column=1, row=0, sticky=(N, S))

        # # Tie the scrollbar to the text views, and the text views
        # # to each other.
        self.project_file_tree.config(yscrollcommand=self.project_file_tree_scrollbar.set)
        self.project_file_tree_scrollbar.config(command=self.project_file_tree.yview)

        # Setup weights for the "project_file_tree" tree
        self.project_file_tree_frame.columnconfigure(0, weight=1)
        self.project_file_tree_frame.columnconfigure(1, weight=0)
        self.project_file_tree_frame.rowconfigure(0, weight=1)

        # Handlers for GUI events
        self.project_file_tree.bind('<<TreeviewSelect>>', self.on_file_selected)