1 Star 0 Fork 0

mr_nobody/python_wx2048

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
test2.py 671 Bytes
一键复制 编辑 原始数据 按行查看 历史
mr_nobody 提交于 2017-03-16 17:57 +08:00 . ...
# coding=utf-8
import wx
class Example(wx.Frame):
def __init__(self, title):
super(Example, self).__init__(None, title=title, size=(250, 150))
# 绑定渲染窗口的动作到OnPaint
# 这样当resize 窗口, 会重新调用该函数
self.Bind(wx.EVT_PAINT, self.OnPaint)
self.Centre()
self.Show()
# 画一条线, 参数为起始点的x, y, 终点的x, y
def OnPaint(self, e):
dc = wx.PaintDC(self)
# dc.DrawLine(50, 60, 190, 60)
dc.DrawLines(((20, 60), (100, 60), (100, 10), (20, 10), (20, 60)))
if __name__ == "__main__":
app = wx.App()
Example('Line')
app.MainLoop()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/mr_nobody/python_wx2048.git
[email protected]:mr_nobody/python_wx2048.git
mr_nobody
python_wx2048
python_wx2048
master

搜索帮助