[wxpython-users] Add a progressbar in a statusbar

Rickey, Kyle W Kyle.Rickey at bakerhughes.com
Thu May 29 06:49:16 PDT 2008


I do this in my app and here's the code I use. self in this case is a class subclassed from wx.Frame

self.statusbar = self.CreateStatusBar()
self.statusbar.SetFieldsCount(3)
self.statusbar.SetStatusWidths([320, -1, -2])

self.progress_bar = wx.Gauge(self.statusbar, -1, 						style=wx.GA_HORIZONTAL|wx.GA_SMOOTH)
rect = self.statusbar.GetFieldRect(1)
self.progress_bar.SetPosition((rect.x+2, rect.y+2))
self.progress_bar.SetSize((rect.width-4, rect.height-4))

self.progress_bar.Hide()

Then whenever I want to use the progress bar, I call

self.progress_bar.Show()
#Code for setting/updating progress bar here.

-Kyle Rickey

________________________________________
From: wxpython-users-bounces at lists.wxwidgets.org [mailto:wxpython-users-bounces at lists.wxwidgets.org] On Behalf Of leticia Fernandez
Sent: Thursday, May 29, 2008 6:39 AM
To: wxpython-users at lists.wxwidgets.org
Subject: [wxpython-users] Add a progressbar in a statusbar

Hello,

I want to add a progressbar into a statusbar, but it seems i cant find how to do it.
Ive got the statusbar and the progressbar done, but i cant see how to link them.
I know when you want to show text, you can do it by SetStatusText ( field, pos )
but I havent seen it for another cases.
Im sure it must be something very obvious, but i cant see it, so.. any idea?
Pleasee some help :)

Thanks in advance

* Leticia.


 

________________________________________

Enviado desde Correo Yahoo!
La bandeja de entrada más inteligente.


More information about the wxpython-users mailing list