wxPython:自定义带进度条的状态栏

本文参考wxPython DEMO,

# -*- coding: utf-8 -*-
import wx

class customStatusBar(wx.StatusBar):
    def __init__(self, parent):
        wx.StatusBar.__init__(self,parent,-1)
        self.SetFieldsCount(2)
        self.SetStatusWidths([-2,-1])
        self.count=0
        self.gauge=wx.Gauge(self,1001,100,pos=(2,2),size=(265,20),style = wx.GA_HORIZONTAL)
        self.gauge.SetBezelFace(3)
        self.gauge.SetShadowWidth(3)
        self.gauge.SetValue(50)


class priceFrame(wx.Frame):
    def __init__(self, parent, id):
        wx.Frame.__init__(self, parent, id, U'带进度条的状态栏', size=(410, 385),
                          style=wx.MINIMIZE_BOX | wx.SYSTEM_MENU | wx.CAPTION | wx.CLOSE_BOX)
        self.openfilename=''
        self.status = customStatusBar(self)
        self.SetStatusBar(self.status)


if __name__ == '__main__':
    app = wx.PySimpleApp()
    frame = priceFrame(parent=None, id=-1)
    frame.Show()
    app.MainLoop()

测试:
wxPython:自定义带进度条的状态栏

你可能感兴趣的:(wxPython,gauge,StatusBar)