Socrates的专栏 发表于 2013-1-1 22:35:15

wxPython:进度条Gauge介绍

<div id="cnblogs_post_body">本节介绍进度条的使用,先看代码:
<div class="cnblogs_code">#!/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()
页: [1]
查看完整版本: wxPython:进度条Gauge介绍