37,719
社区成员
发帖
与我相关
我的任务
分享
def OnApply(self, event):
#self.Destroy()
remote_configs.clear() #先清空数据
rec = d4i.DictIni('remote_config.ini') # 然后再建立一个数据对象
remote_configs = rec.remote_configs._items # 也是一个数据对象
self.parent.Close() #把现有窗口关闭
dlg = wx.Dialog(None, -1, title='Remote Setting Dialog',size =(500,500),style = wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER)
remote = RemotePanel(dlg,self.log) #重新建立窗口对象
rec.save()
#dlg.SetSize(dlg.GetBestSize())
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(remote,1,wx.EXPAND)
dlg.SetSizer(sizer)
#sizer.Fit(dlg)
#dlg.SetAutoLayout(True)
dlg.ShowModal()
dlg.Destroy()
config = wx.FileConfig(wx.EmptyString, wx.EmptyString, "myapp.ini", wx.EmptyString, wx.CONFIG_USE_LOCAL_FILE)
wx.ConfigBase_Set(config)
config = wx.ConfigBase_Get()
dlg.username = config.Read("username", "")
config.Write("username", dlg.username)