当前位置: 首页>>代码示例>>Python>>正文


Python Manager.refresh_tabs方法代码示例

本文整理汇总了Python中Manager.Manager.refresh_tabs方法的典型用法代码示例。如果您正苦于以下问题:Python Manager.refresh_tabs方法的具体用法?Python Manager.refresh_tabs怎么用?Python Manager.refresh_tabs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Manager.Manager的用法示例。


在下文中一共展示了Manager.refresh_tabs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: MainFrame

# 需要导入模块: from Manager import Manager [as 别名]
# 或者: from Manager.Manager import refresh_tabs [as 别名]
class MainFrame(wx.Frame):
    def __init__(self, parent, id, title):
        self._settings = Settings()
        
        if self._settings.val('phenix'):
            import sys
                
            p = self._settings.val('phenix')
            base = p + '/Contents/' + os.path.basename(p).lower()
            if os.path.exists(base):
                sys.path.append(base + '/elbow')
                sys.path.append(base)
                libtbx.env.add_repository(base)
                libtbx.env.process_module(None, 'elbow', False)
        
        CootClient.set_start_coot(self.start_coot)
        SettingsDialog.set_settings(self._settings)
        HelpDialog.set_settings(self._settings)
        
        wx.Frame.__init__(self, parent, id, title, size=(850,540))
        self.Bind(wx.EVT_CLOSE, self._on_close)
        
        self.toolbar = wx.ToolBar(self, style=wx.TB_3DBUTTONS|wx.TB_TEXT)
        quit = self.toolbar.AddLabelTool(wx.ID_ANY, 'Quit', wxtbx.bitmaps.fetch_icon_bitmap('actions', 'exit'))
        settings = self.toolbar.AddLabelTool(wx.ID_ANY, 'Settings', wxtbx.bitmaps.fetch_icon_bitmap('actions', 'configure'))
        about = self.toolbar.AddLabelTool(wx.ID_ANY, 'About', wxtbx.bitmaps.fetch_icon_bitmap('actions', 'info'))
        help = self.toolbar.AddLabelTool(wx.ID_ANY, 'Help', wxtbx.bitmaps.fetch_icon_bitmap('actions', 'agt_support'))
        self.toolbar.AddSeparator()
        coot = self.toolbar.AddLabelTool(wx.ID_ANY, 'Coot', wx.Bitmap(self._settings.proot + 'Resources/gui_resources/coot.png'))
        ligand = self.toolbar.AddLabelTool(wx.ID_ANY, 'Ligands', wx.Bitmap(self._settings.proot + 'Resources/gui_resources/ligand_32.png'))
        self.SetToolBar(self.toolbar)
        self.toolbar.Realize()
        
        self.Bind(wx.EVT_TOOL, self._on_close, quit)
        self.Bind(wx.EVT_TOOL, self.start_coot, coot)
        self.Bind(wx.EVT_TOOL, self._show_settings, settings)
        self.Bind(wx.EVT_TOOL, self._show_about, about)
        self.Bind(wx.EVT_TOOL, self._show_help, help)
        self.Bind(wx.EVT_TOOL, self._view_ligand, ligand)
        
        self._coot_timer = None
        self._coot_process = None
        self._coot_client = CootClient()

        nb = wx.aui.AuiNotebook(self, -1, style=wx.NB_TOP)
        self.sheet1 = Manager(nb)
        
        Tab.set_settings(self._settings)
        CootClient.set_p8(self._settings.proot)
        
        Tab.set_coot_client(self._coot_client)
        Tab.set_start_coot(self.start_coot)
        Tab.set_update_sb(self.set_status)
        
        self.sheet2 = ProcessManager(nb)
        self.sheet3 = Compare(nb)
        
        Jobs.set_new_refinement(self.sheet2.new_refinement)
        Jobs.set_load_refinement(self.sheet2.load_refinement)
        Jobs.set_auto_refinement(self.sheet2.auto_refinement)

        nb.AddPage(self.sheet1, 'Manage')
        nb.AddPage(self.sheet2, 'Process')
        nb.AddPage(self.sheet3, 'Compare')

        self.sb = self.CreateStatusBar()
        self.sb.SetFieldsCount(2)
        self.sb.SetStatusWidths([-4, -1])
        self.sheet2.SetFocus()

        self.sheet1.load_project()
        self.sheet1.refresh_tabs()
        #self.sheet1.sheet2._test()
    
    def _view_ligand(self, event):
        dlg = wx.FileDialog(self, 'Select a PDB file to load', defaultDir=os.getcwd(), wildcard='PDB File|*.pdb')
    
        if dlg.ShowModal() == wx.ID_OK:
            lig = Ligand(str(dlg.GetPath()), os.path.basename(str(dlg.GetPath())))
            lig.Show(True)

        dlg.Destroy()
    
    
    def _show_settings(self, event):
        dlg = SettingsDialog(self)
        dlg.Show(True)
    
    def _show_about(self, event):
        dlg = AboutDialog(self)
        dlg.Show(True)
    
    
    def _show_help(self, event):
        dlg = HelpDialog(self)
        dlg.Show(True)
    
    def set_status(self, text, fld =0):
        self.sb.SetStatusText(text, fld)

#.........这里部分代码省略.........
开发者ID:stufisher,项目名称:Proton8,代码行数:103,代码来源:Proton8.py


注:本文中的Manager.Manager.refresh_tabs方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。