def instantiate_and_store_widgets(self):
        """Instantiate and store panels and other objects."""
        ### instantiate directory panel
        dir_panel = DirectoryPanel(self)

        ### store it in its own attribute in this file
        ### manager, as well as several of its
        ### operations/objects

        ## store panel
        self.dir_panel = dir_panel

        ## for each attribute name, retrieve that attribute
        ## from the directory panel and store that same
        ## attribute, using the same name, on this instance

        for attribute_name in (
            "go_to_previous",
            "go_to_next",
            "jump_many_up",
            "jump_many_down",
            "go_to_first",
            "go_to_last",
            "select_all",
            "deselect_all",
            "load_parent",
            "load_home",
            "load_selected",
            "parent_button",
            "home_button",
            "reload_dir_button",
            "new_file_button",
            "new_folder_button",
            "navigation_entry"
        ):
            attribute = getattr(dir_panel, attribute_name)
            setattr(self, attribute_name, attribute)

        ### instantiate and store the bookmark panel,
        ### passing along references to the directory
        ### panel and our rect sized semitransparent
        ### object

        self.bkm_panel = BookmarkPanel(
            self.dir_panel,
            self.rect_size_semitransp_obj,
        )

        ### also reference bookmark panel buttons

        for attr_name in ("bookmark_button", "unbookmark_button"):
            button = getattr(self.bkm_panel, attr_name)
            setattr(self, attr_name, button)

        ### store panels

        self.panels = Set2D()
        self.panels.update((self.dir_panel, self.bkm_panel))

        ### create a submit button and a cancel button (we
        ### use text objects with a simple finish to give
        ### them depth)

        ## submit button

        self.submit_button = Object2D.from_surface(
            surface=render_text(
                t.file_manager.submit,
                font_height=FONT_HEIGHT,
                foreground_color=BUTTON_FG,
                background_color=BUTTON_BG,
                padding=5,
                depth_finish_thickness=1,
            ),
        )

        self.submit_button.on_mouse_release = get_oblivious_callable(
            self.submit
        )

        ## cancel button

        self.cancel_button = Object2D.from_surface(
            surface=render_text(
                t.file_manager.cancel,
                font_height=FONT_HEIGHT,
                foreground_color=BUTTON_FG,
                background_color=BUTTON_BG,
                padding=5,
                depth_finish_thickness=1,
            ),
        )

        self.cancel_button.on_mouse_release = (
            get_oblivious_callable(self.cancel)
        )

        ### create an entry widget to edit path names;

        self.selection_entry = StringEntry(
            value='',
            loop_holder=self,
            font_height=FONT_HEIGHT,
            draw_on_window_resize=self.draw,
            width=550,
            command=self.update_selection_from_entry,
        )

        ### reference all buttons together in a set

        self.buttons = Set2D(
            (
                self.home_button,
                self.reload_dir_button,
                self.parent_button,
                self.new_file_button,
                self.new_folder_button,
                self.bookmark_button,
                self.unbookmark_button,
                self.navigation_entry,
                self.selection_entry,
                self.cancel_button,
                self.submit_button,
            )
        )
Instantiate and store panels and other objects.
nodezator/fileman/main.py