[ wxwindows-Bugs-1522697 ] Gauge Refresh Problem

SourceForge.net noreply at sourceforge.net
Fri Jul 14 10:52:30 PDT 2006


Bugs item #1522697, was opened at 2006-07-14 17:52
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1522697&group_id=9863

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: wxPython specific
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Adam Spencer (doctorwebbox)
Assigned to: Robin Dunn (robind)
Summary: Gauge Refresh Problem

Initial Comment:
I'm very new to wxpython and couldn't figure out why I
couldn't get wx.Gauges to fill properly so I wrote some
sample code and got a friend to have a look that is
much more knowledgable about this than me. He says that
the code SHOULD work and that the problem must be a bug.

Here is the sample code:

import wx
import threading
import time

class FillGauge(threading.Thread):
	
	def __init__(self, gauge):
		
		threading.Thread.__init__(self)
		
		self.gauge = gauge
		
	def run(self):
		
		for a in range(0, 100):
			print str(a)
			gauge = self.gauge
			gauge.SetValue(a)
			#print "Refreshing"
			#gauge.Refresh(True)
			print "Refreshed"
			time.sleep(1)

class GaugeExperiment(threading.Thread):
	
	def __init__(self):
		
		threading.Thread.__init__(self)
		
	def run(self):
		
		app = wx.App()
		frame = wx.Frame(None, -1, "Adams Frame")
		
		sizer = wx.BoxSizer(wx.VERTICAL)
		
		label = wx.StaticText(frame, -1, "Gauge Experiment")
		sizer.Add(label)
		
		frame.gauge = wx.Gauge(frame, -1)
		sizer.Add(frame.gauge)
		
		gobutton = wx.Button(frame, -1, "Go")
		gobutton.Bind(wx.EVT_BUTTON, self.StartFillGauge)
		sizer.Add(gobutton)
		
		frame.SetSizer(sizer)
		
		frame.Show()
		
		app.MainLoop()

	def StartFillGauge(self, ID):
		
		parent = ID.GetEventObject().GetParent()
		gauge = parent.gauge
		filling = FillGauge(gauge)
		filling.start()
		print "Done"

experiment = GaugeExperiment()
experiment.start()

When I run this code the gauge starts to fill and then
stops. If I think click the button and don't release
the left mouse button but sort of jiggle the pointer
about over the button - the gauge fills.

I'm running ubuntu linux (breezy) and using wxpython
version 2.6.1.1pre (this is just the version that
ubuntu gave me).

Is this really a bug or do I just not understand how to
use the gauge?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1522697&group_id=9863




More information about the wx-dev mailing list