wx.ProgressDialog is not returning a Tuple

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ejether
    New Member
    • Jun 2010
    • 7

    wx.ProgressDialog is not returning a Tuple

    Hi all,
    I'm trying to get the
    (continue, skip) = wx.ProgressDial og(...)
    but I keep getting an error

    I stole the code below from another post regarding the wx.ProgressDial og and it was reported as working there but it gives me the same error.

    Code:
    (before) count: 1, keepGoing: True, skip: False 
    Traceback (most recent call last):
      File "progdial.py", line 28, in <module>
        (keepGoing, skip) = dlg.Update(count, newtext)
    TypeError: 'bool' object is not iterable


    Code:
    import wx
    import time
    
    max = 10
    app = wx.PySimpleApp()
    dlg = wx.ProgressDialog("Progress dialog example",
    "variables to be shown here",
    maximum = max,  
    style = wx.PD_CAN_ABORT
    | wx.PD_CAN_SKIP
    #| wx.PD_APP_MODAL
    | wx.PD_ELAPSED_TIME  
    | wx.PD_ESTIMATED_TIME
    | wx.PD_REMAINING_TIME
    )
    
    keepGoing = True
    skip = False
    count = 0
    
    while keepGoing and count < max:
      count += 1
      wx.MilliSleep(1000)
      #time.sleep(1)
      newtext = "(before) count: %s, keepGoing: %s, skip: %s " % \
      (count, keepGoing, skip)
      print newtext
      (keepGoing, skip) = dlg.Update(count, newtext)
      newtext = "(after) count: %s, keepGoing: %s, skip: %s " % \
      (count, keepGoing, skip)
      print newtext
    
    dlg.Destroy()
    I am using Python 2.6.2 and python-wxgtk2.8 on Ubuntu 9.04

    Any suggestions are greatly appreceiated, I haven't been able to google up anyone with the same problem.

    EJ
  • ejether
    New Member
    • Jun 2010
    • 7

    #2
    Nevermind
    I did a wxversion.selec t('2.8') and that seems to work.

    How can I set that as the default?

    Comment

    • ejether
      New Member
      • Jun 2010
      • 7

      #3
      Skip parameter always true

      In the above code, the skip value is False only for the first iteration. It becomes True after the fist Update() call even if the Skip button has been pushed.

      Has anyone else seen this problem?
      Whats going on?

      EJ

      Comment

      Working...