wxpython SplitterWindow panel 刷新后不能正确显示的问题?,,现在用wxpython
wxpython SplitterWindow panel 刷新后不能正确显示的问题?,,现在用wxpython
现在用wxpython 做联系人应用,希望实现点击左侧联系人列表刷新右侧联系人信息现在使用了wx.SplitterWindow, ReplaceWindow(winOld, winNew)现在点击实现了替换,返回了True 。但是替换后不能在右侧显示。SplitterWindow 部分代码:
class SplitterContacts(wx.SplitterWindow): def __init__(self, parent, ID): wx.SplitterWindow.__init__(self, parent, ID, style = wx.SP_LIVE_UPDATE) self.sp = wx.SplitterWindow(self) self.InitSplitter() def InitSplitter(self): self.SetSize((500, 500)) style = wx.BORDER_SUNKEN with open('contacts.json', 'r') as contacts: contacts = contacts.read() contacts = json.loads(contacts) contact = contacts.values()[0] left_list = wx.Panel(self, style=style) left_list = ListContactsPanel(self, style=style, contacts=contacts) left_list.SetBackgroundColour("sky blue") right_list = ContactDetail(self, style=style, contact=contact) right_list.SetBackgroundColour("pink") self.SetMinimumPaneSize(200) self.SplitVertically(left_list, right_list, -400)
点击响应事件 处理
def OnColClick(self, evt): i = evt.GetIndex() contact = self.contacts.values()[i] left = self.parent.GetWindow1() old = self.parent.GetWindow2() old.SetBackgroundColour("blue") style = wx.BORDER_SUNKEN new = ContactDetail(self, style=style, contact=contact) self.parent.ReplaceWindow(old, new) old.Destroy() new.Show(True)
不知道哪里出了错误!请教一下谢谢!
编橙之家文章,
相关内容
- Python 类方法中的变量什么时候要加上self ?,pythonsel
- SecureCRT脚本(Python)中怎么获取串口发送命令的返回值
- python的循环中else子句的必要的应用场景是什么?,py
- 在给Sublime Text 2 做插件的时候怎么引用Python Markdown和
- 如何获取TED带字幕的视频下载url,ted视频下载,准备爬一
- 豆瓣FM如何生成请求音乐列表的表单,豆瓣fm生成表单
- 如何實現以下算法,實現算法,將任意一個包含任意數字
- .vim 脚本如何获取 vimrc中的某个值?,.vimvimrc,比如.vi
- Web.py -AttributeError: 'module' object has no attribute 'ge,,code.
- django:在打开admin页面的时候出错了(其它页面能正常
评论关闭