wxPython:进度条Gauge介绍
2013-03-16 00:00
141 查看
#!/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-22 ''' class GuageFrame(wx.Frame): def __init__(self): wx.Frame.__init__(self, None, -1, 'Gauge Example', size = (600, 300)) panel = wx.Panel(self, -1) panel.SetBackgroundColour("white") self.count = 0 self.gauge = wx.Gauge(panel, -1, 100, (100, 60), (250, 25), style = wx.GA_PROGRESSBAR) self.gauge.SetBezelFace(3) self.gauge.SetShadowWidth(3) self.Bind(wx.EVT_IDLE, self.OnIdle) def OnIdle(self, event): self.count = self.count + 1 if self.count >= 80: self.count = 0 self.gauge.SetValue(self.count) if __name__ == '__main__': app = wx.PySimpleApp() frame = GuageFrame() frame.Show() app.MainLoop()
测试:
知识点介绍:
原型:
bool Create(wxWindow* parent, wxWindowID id, int range, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxGA_HORIZONTAL, const wxValidator& validator = wxDefaultValidator, const wxString& name = "gauge")
方法:
wxGauge::wxGauge
wxGauge::~wxGauge
wxGauge::Create
wxGauge::GetBezelFace
wxGauge::GetRange
wxGauge::GetShadowWidth
wxGauge::GetValue
wxGauge::IsVertical
wxGauge::SetBezelFace
wxGauge::SetRange
wxGauge::SetShadowWidth
wxGauge::SetValue
wxGauge::Pulse
相关文章推荐
- wxPython:进度条Gauge介绍
- wxPython:进度条Gauge介绍
- wxPython:事件处理介绍一
- wxPython:绘画按钮BitmapButton介绍
- wxPython:启动画面SplashScreen介绍
- wxPython:绘画按钮BitmapButton介绍
- wxPython:布局管理器sizer介绍
- wxPython:事件处理介绍二
- wxPython:事件处理介绍一
- wxPython:状态栏介绍
- wxPython:菜单介绍
- wxPython:事件处理介绍二
- wxPython:布局管理器sizer介绍
- wxPython:状态栏介绍
- wxPython:菜单介绍
- wxPython:应用程序对象介绍
- wxPython:Frame类介绍
- wxPython:应用程序对象介绍
- wxPython:布局管理器sizer介绍
- wxPython:状态栏介绍