wxpython text inside a gauge progress bar
问题 I am building an GUI using WxPython, and was wondering if there is a way to put a text inside a gauge progress bar. This is in order to show users the battery status both with image and text. 回答1: Use the agw.PyGauge import wx import wx.lib.agw.pygauge as PG class MyFrame(wx.Frame): def __init__(self, parent): wx.Frame.__init__(self, parent, -1, "PyGauge Demo", size=(200,100)) panel = wx.Panel(self) gauge1 = PG.PyGauge(panel, -1, size=(100, 25), style=wx.GA_HORIZONTAL) gauge1.SetValue(80)