hostswitcher.py 文件源码

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

项目:hostswitcher 作者: fiefdx 项目源码 文件源码
def __init__(self, *args, **kwds):
        wx.Frame.__init__(self, *args, **kwds)
        self.icon = wx.Icon("/usr/share/icons/hicolor/128x128/apps/switch-icon.png", wx.BITMAP_TYPE_PNG)
        self.SetIcon(self.icon)
        with open(CurrentHosts, "rb") as fp:
            self.current = fp.read()
        self.all_hosts = get_all_hosts()

        self.combo_box_1 = wx.ComboBox(self, wx.ID_ANY, choices = self.all_hosts, style = wx.CB_DROPDOWN)
        index = 0
        try:
            index = self.all_hosts.index(self.current)
        except Exception:
            pass
        self.combo_box_1.Select(index)
        self.button_add = wx.Button(self, wx.ID_ANY, "Add")
        self.button_delete = wx.Button(self, wx.ID_ANY, "Delete")
        self.button_edit = wx.Button(self, wx.ID_ANY, "Edit")
        self.button_set = wx.Button(self, wx.ID_ANY, "Set")
        self.Bind(wx.EVT_BUTTON, self.OnAdd, self.button_add)
        self.Bind(wx.EVT_BUTTON, self.OnDelete, self.button_delete)
        self.Bind(wx.EVT_BUTTON, self.OnEdit, self.button_edit)
        self.Bind(wx.EVT_BUTTON, self.OnSet, self.button_set)
        self.statusbar = self.CreateStatusBar(1)

        self.__set_properties()
        self.__do_layout()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号