gui.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:modis 作者: Infraxion 项目源码 文件源码
def module_selected(self, module_name, module_ui):
        """
        Called when a module is selected

        Args:
            module_name (str): The name of the module
            module_ui: The function to call to create the module's UI
        """
        if self.current_button == self.module_buttons[module_name]:
            return

        self.module_buttons[module_name].config(bg="#cacaca")
        if self.current_button is not None:
            self.current_button.config(bg="white")
        self.current_button = self.module_buttons[module_name]

        self.clear_ui()

        try:
            # Create the UI
            module_ui_frame = ModuleUIBaseFrame(self.module_ui, module_name, module_ui)
            module_ui_frame.grid(column=0, row=0, sticky="W E N S")
        except Exception as e:
            logger.error("Could not load UI for {}".format(module_name))
            logger.exception(e)
            # Create a error UI
            tk.Label(self.module_ui, text="Could not load UI for {}".format(module_name)).grid(
                column=0, row=0, padx=0, pady=0, sticky="W E N S")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号