wx.ProgressDialog
대화 상자에 추가 내용 (일시 중지 단추 및 현재 처리중인 내용에 대한 정보)을 추가해야하므로 사용할 수 없습니다. 내 대화 상자에서 사용할 수있는 진행 표시 줄에 대한 컨트롤이 있습니까?wxPython 진행률 표시 줄
나는 당연히 무언가 간단한 것을 그릴 수 있지만, 프로그램이 Mac OS X, Windows 및 Linux에서 실행되어야하므로 진행 막대에 기본 모양이있는 것이 좋습니다.
wx.ProgressDialog
대화 상자에 추가 내용 (일시 중지 단추 및 현재 처리중인 내용에 대한 정보)을 추가해야하므로 사용할 수 없습니다. 내 대화 상자에서 사용할 수있는 진행 표시 줄에 대한 컨트롤이 있습니까?wxPython 진행률 표시 줄
나는 당연히 무언가 간단한 것을 그릴 수 있지만, 프로그램이 Mac OS X, Windows 및 Linux에서 실행되어야하므로 진행 막대에 기본 모양이있는 것이 좋습니다.
가로 또는 세로 막대를 표시하는 wx 게이지는 어떻습니까?
http://www.wxpython.org/docs/api/wx.Gauge-class.html
더 완전한 C++ 문서 : http://docs.wxwidgets.org/2.6/wx_wxgauge.html#wxgauge
당신은 항상 wx.Dialog의 자신의 유도체를 생성하고 선별기를 사용하여, 당신이 필요로하는 위젯에 추가 할 수 있습니다.
여기 내 프로그램에서 하나의 예를 들어, :
class ProgressDialog(wx.Dialog):
"""
Shows a Progres Gauge while an operation is taking place. May be cancellable
which is possible when converting pdf/ps
"""
def __init__(self, gui, title, to_add=1, cancellable=False):
"""Defines a gauge and a timer which updates the gauge."""
wx.Dialog.__init__(self, gui, title=title,
style=wx.CAPTION)
self.gui = gui
self.count = 0
self.to_add = to_add
self.timer = wx.Timer(self)
self.gauge = wx.Gauge(self, range=100, size=(180, 30))
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(self.gauge, 0, wx.ALL, 10)
if cancellable:
cancel = wx.Button(self, wx.ID_CANCEL, _("&Cancel"))
cancel.SetDefault()
cancel.Bind(wx.EVT_BUTTON, self.on_cancel)
btnSizer = wx.StdDialogButtonSizer()
btnSizer.AddButton(cancel)
btnSizer.Realize()
sizer.Add(btnSizer, 0, wx.ALIGN_CENTER | wx.TOP | wx.BOTTOM, 10)
self.SetSizer(sizer)
sizer.Fit(self)
self.SetFocus()
self.Bind(wx.EVT_TIMER, self.on_timer, self.timer)
self.timer.Start(30)
def on_timer(self, event):
"""Increases the gauge's progress."""
self.count += self.to_add
self.gauge.SetValue(self.count)
if self.count > 100:
self.count = 0
def on_cancel(self, event):
"""Cancels the conversion process"""
# do whatever