六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 314|回复: 0

wxPython:进度条Gauge介绍

[复制链接]

升级  73.33%

50

主题

50

主题

50

主题

秀才

Rank: 2

积分
160
 楼主| 发表于 2013-1-1 22:35:13 | 显示全部楼层 |阅读模式
<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()
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表