Search code examples
wxpython

Want to change progress bar color to Black in wx python


i want to change my progrssbar color to Black which is green. i think by default it is green I am trying with self.progress_bar.color but doesnot reflect any change i think there will be any inbuilt method but i am unable to find it.


Solution

  • The above answer is definitely the way to go, although if you are just looking for the progress without the Dialog, then you might want to look at the sub class Progress gauge.

    Please see the documentation for wx.lib.agw.pyprogress.ProgressGauge:

    http://wxpython.org/docs/api/wx.lib.agw.pyprogress.ProgressGauge-class.html

    Example:

    import wx.lib.agw.pyprogress.ProgressGauge as pg
    
    prog = pg.ProgressGauge(self, -1)
    prog.SetGaugeBackground(wx.Colour(0, 0, 0))
    

    For reference, you might want to see the link below as this question has already been answered on Stack Overflow:

    Wxpython How to change the colour of Gauge Progress bar in windows