I have a example of wx.ActivityIndicator. I try to set color for an animation indicating,but Whether I set foreground or backgroundcolor, it doesn’t work。What is it going to do?
class MyFrame10(wx.Frame):
def __init__(self):
wx.Frame.__init__(self,None,-1,'ty',size=(600,300))
self.pn1=wx.Panel(self)
pn2=wx.Panel(self)
pn2.SetBackgroundColour('red')
self.pn1.SetBackgroundColour('light blue')
self.btn=wx.Button(self.pn1,-1,'press')
vbox = wx.BoxSizer(wx.VERTICAL)
vbox.Add(self.pn1, flag=wx.ALL|wx.EXPAND,proportion=1)
vbox.Add(pn2,flag=wx.ALL|wx.EXPAND,proportion=2)
self.SetSizer(vbox)
self.ac=None
self.Bind(wx.EVT_BUTTON,self.active,self.btn)
def active(self,e):
if not self.ac:
self.ac = wx.ActivityIndicator()
self.ac.Create(self.pn1,pos=(150,30),size=(50,50))
self.ac.Start()
self.ac.SetOwnForegroundColour('yellow')
self.ac.SetScrollbar(100, 60, 50, 15)
print(self.ac.UseForegroundColour())
else:
print('a.colBg')
self.ac.Stop()
self.ac.Destroy()
self.ac=None
class myapp(wx.App):
def OnInit(self):
frame = MyFrame10()
frame.Show()
return True
if __name__ == '__main__':
app = myapp()
app.MainLoop()