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()
评论列表
文章目录