main.py 文件源码

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

项目:i3ColourChanger 作者: PMunch 项目源码 文件源码
def InitUI(self,config=None):
        artprovider = wx.ArtProvider()
        toolbar = self.CreateToolBar(style=wx.TB_TEXT|wx.TB_HORZ_LAYOUT)
        toolOpen = toolbar.AddTool(wx.ID_ANY, 'Open', artprovider.GetBitmap(wx.ART_FILE_OPEN,client=wx.ART_TOOLBAR),"Open an i3 config file")
        toolSave = toolbar.AddTool(wx.ID_ANY, 'Save', artprovider.GetBitmap(wx.ART_FILE_SAVE,client=wx.ART_TOOLBAR),"Save the current settings to the open file")
        toolApply = toolbar.AddTool(wx.ID_ANY, 'Apply', artprovider.GetBitmap(wx.ART_TICK_MARK,client=wx.ART_TOOLBAR),"Apply the changes without changing file")
        toolUpdateLocal = toolbar.AddTool(wx.ID_ANY, 'Save to config', artprovider.GetBitmap(wx.ART_FILE_SAVE_AS,client=wx.ART_TOOLBAR),"Save the current colour scheme into your current config")
        toolSnippet = toolbar.AddTool(wx.ID_ANY, 'Create colour snippet', artprovider.GetBitmap(wx.ART_NEW,client=wx.ART_TOOLBAR),"Save the current colour scheme as a standalone colour file you can send to others")
        toolVariable = toolbar.AddTool(wx.ID_ANY, 'Create colour variable', artprovider.GetBitmap(wx.ART_PLUS,client=wx.ART_TOOLBAR),"Create a new colour variable")
        toolbar.AddStretchableSpace()
        toolQuit = toolbar.AddTool(wx.ID_ANY, 'Quit', artprovider.GetBitmap(wx.ART_QUIT,client=wx.ART_TOOLBAR),"Quit the program")

        self.Bind(wx.EVT_TOOL, self.OnQuit,toolQuit)
        self.Bind(wx.EVT_TOOL, self.OnOpen,toolOpen)
        self.Bind(wx.EVT_TOOL, self.OnApply,toolApply)
        self.Bind(wx.EVT_TOOL, self.OnSave,toolSave)
        self.Bind(wx.EVT_TOOL, self.OnUpdateLocal,toolUpdateLocal)
        self.Bind(wx.EVT_TOOL, self.OnCreateSnippet,toolSnippet)
        self.Bind(wx.EVT_TOOL, self.OnCreateVariable,toolVariable)

        self.scrolled = wx.lib.scrolledpanel.ScrolledPanel(self,-1)
        self.scrolled.SetupScrolling()
        self.scrolled.Show()

        self.Centre()
        self.Show(True)

        if config!=None:
            self.LoadConfig(config)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号