wxPython:绘画按钮BitmapButton介绍
来源:互联网 发布:ghost覆盖 数据恢复 编辑:程序博客网 时间:2024/05/16 07:45
本节看一个绘图按钮的使用,先看看代码:
#!/usr/bin/env python# -*- coding: utf-8 -*-import wx''' Function:绘图 Input:NONE Output: NONE author: socrates blog:http://www.cnblogs.com/dyx1024/ date:2012-07-20''' class BitmapButtonFrame(wx.Frame): def __init__(self): wx.Frame.__init__(self, None, -1, "Bitmap button example", size = (600, 400)) panel = wx.Panel(self, -1) panel.SetBackgroundColour("blue") #创建一个绘图对象 bmp = wx.Image("test2.bmp", wx.BITMAP_TYPE_BMP).ConvertToBitmap() #绘图按钮1,默认风格3D self.button = wx.BitmapButton(panel, -1, bmp, pos = (50, 20)) self.Bind(wx.EVT_BUTTON, self.OnClick, self.button) self.button.SetDefault() #绘图按钮1,不带边框 self.button2 = wx.BitmapButton(panel, -1, bmp, style = 0, pos = (350, 20)) self.Bind(wx.EVT_BUTTON, self.OnClick, self.button) self.button.SetDefault() def OnClick(self, event): self.Destroy() if __name__ == '__main__': app = wx.PySimpleApp() frame = BitmapButtonFrame() frame.Show() app.MainLoop()测试:
知识点介绍:
原型:
wxBitmapButton( wxWindow* parent, wxWindowID id, const wxBitmap& bitmap, constwxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW, const wxValidator& validator = wxDefaultValidator, const wxString&name = "button")
方法:
- wxBitmapButton::Create
- wxBitmapButton::GetBitmapDisabled
- wxBitmapButton::GetBitmapFocus
- wxBitmapButton::GetBitmapHover
- wxBitmapButton::GetBitmapLabel
- wxBitmapButton::GetBitmapSelected
- wxBitmapButton::SetBitmapDisabled
- wxBitmapButton::SetBitmapFocus
- wxBitmapButton::SetBitmapHover
- wxBitmapButton::SetBitmapLabel
- wxBitmapButton::SetBitmapSelected
- wxPython:绘画按钮BitmapButton介绍
- 图形按钮BitmapButton的实现
- bitmapbutton
- 用wx.BitmapButton创建图片按钮
- 2011-3 使用BitmapButton实现按钮加载图标
- wxPython:应用程序对象介绍
- wxPython:Frame类介绍
- wxPython:状态栏介绍
- wxPython:菜单介绍
- wxPython:进度条Gauge介绍
- wxPython:事件处理介绍一
- wxPython:事件处理介绍二
- wxPython:布局管理器sizer介绍
- wxPython:启动画面SplashScreen介绍
- wxPython:布局管理器sizer介绍
- 绘画
- 绘画
- 绘画
- MediaRecorder framework层的处理流程
- 求贤若渴
- Windows Media Player 解码器 win7codecs
- wxPython:启动画面SplashScreen介绍
- 责任链模式
- wxPython:绘画按钮BitmapButton介绍
- Android电话拨号器
- 关于tomcat服务器部署,页面报404/500错误,myeclipse异常关闭 导致tomcat 6.0 无法重启 的问题
- wxPython:进度条Gauge介绍
- UITableView 使用方法(一) - 创建简单的列表
- 2005年企业员工保险福利调查报告
- Grub2 Configuration (boot menu)
- 解析Unix下的缓冲区溢出防御体系
- win7远程桌面连接设置