摘要: import wx class Mywin(wx.Frame): def __init__(self, parent, title): super(Mywin, self).__init__(parent, title = title,size = (350,250)) panel = wx.Panel(self) vbox... 阅读全文
posted @ 2018-06-10 16:41 萌新上路 阅读(650) 评论(0) 推荐(0) 编辑
摘要: # -*- coding: utf-8 -*- import wx import os class my_frame(wx.Frame): """This is a simple text editor""" def __init__(self,parent, title): wx.Frame.__init__(self, parent, title=title,... 阅读全文
posted @ 2018-06-10 12:35 萌新上路 阅读(179) 评论(0) 推荐(0) 编辑
摘要: #coding:UTF-8 import wx app = wx.App() def dragEVT(event): if event.ButtonDown(): panel1.SetPosition(event.GetPosition()) elif event.Dragging(): panel1.SetPos... 阅读全文
posted @ 2018-06-10 12:14 萌新上路 阅读(126) 评论(0) 推荐(0) 编辑
摘要: wxPython首先在触发对象中查找匹配事件类型的被绑定的处理器函数,如果找到,刚相应方法被执行。如果没找到,wxPython将检查该事件是否传送到了上一级的容器,如果是,父窗口被检查,如此一级级向上查找,直到找到一个处理函数或到达顶层窗口。 阅读全文
posted @ 2018-06-10 12:12 萌新上路 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 事件处理是wxPython程序工作的基本机制,先看几个术语: 事件(event):应该程序期间发生的事情,要求有一个响应。 事件对象(event object):代表具体一个事件,包括事件的数据属性,为wx.Event或其子类的实例,如wx.CommandEvent/wx.MouseEvent。 事 阅读全文
posted @ 2018-06-10 12:10 萌新上路 阅读(180) 评论(0) 推荐(0) 编辑
摘要: wxSingleChoiceDialog(wxWindow* parent, const wxString& message, const wxString& caption, int n, const wxString* choices, void** clientData = NULL, lon 阅读全文
posted @ 2018-06-10 12:05 萌新上路 阅读(316) 评论(0) 推荐(0) 编辑
摘要: wxTextEntryDialog(wxWindow* parent, const wxString& message, const wxString& caption = "Please enter text", const wxString& defaultValue = "", long st 阅读全文
posted @ 2018-06-10 12:03 萌新上路 阅读(415) 评论(0) 推荐(0) 编辑
摘要: wxMessageDialog(wxWindow* parent, const wxString& message, const wxString& caption = "Message box", long style = wxOK | wxCANCEL, const wxPoint& pos = 阅读全文
posted @ 2018-06-10 12:02 萌新上路 阅读(2224) 评论(0) 推荐(0) 编辑
摘要: SetFieldsCount()方法设置将状态分为几个区。 SetStatusText()用于设置状态栏内容。 SetStatusWidth()用于设置各栏宽度,该方法要求一个整数的Python列表作为参数,列表的长度必须和状态栏中哉的数量一致。按列表中整数的顺序来计算对应域的宽度。如果整数是正值, 阅读全文
posted @ 2018-06-10 12:00 萌新上路 阅读(518) 评论(0) 推荐(0) 编辑
摘要: Panel是窗口的容器,通常其大小与Frame一样,在其上放置各种控件,这样可将窗口内容与工具栏及状态栏区分开,能过TAB键可遍历Panel中的元素 小构件,如按钮,文本框等被放置在面板窗口。 wx.Panel类通常是被放在一个wxFrame对象中。这个类也继承自wxWindow类。 Panel是窗 阅读全文
posted @ 2018-06-10 11:57 萌新上路 阅读(878) 评论(0) 推荐(0) 编辑