ProgressDialog skip parameter always returns True

Hi All.
I'm having trouble with the Skip parameter on the Progress Dialog.
Using the following code, which I stole from another board for
testing, after the first iteration, skip is always True even when the
button has not been pressed.
HELP

EJ

[code]
import wxversion
wxversion.select("2.8")
import wx
import time

print wx.VERSION_STRING

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.UpdatePulse()
  newtext = "(after) count: %s, keepGoing: %s, skip: %s " % \
  (count, keepGoing, skip)
  print newtext

dlg.Destroy()
[/code]

Platform and version?

···

On 10/22/10 3:10 PM, EJ wrote:

Hi All.
I'm having trouble with the Skip parameter on the Progress Dialog.
Using the following code, which I stole from another board for
testing, after the first iteration, skip is always True even when the
button has not been pressed.
HELP

--
Robin Dunn
Software Craftsman

Ubuntu 9.04
Current .deb packages for that release.
wx is 2.8
Python is 2.6 I think. I'm away from it right now.

···

On Oct 23, 2010, at 12:21 PM, Robin Dunn <robin@alldunn.com> wrote:

On 10/22/10 3:10 PM, EJ wrote:

Hi All.
I'm having trouble with the Skip parameter on the Progress Dialog.
Using the following code, which I stole from another board for
testing, after the first iteration, skip is always True even when the
button has not been pressed.
HELP

Platform and version?

--
Robin Dunn
Software Craftsman
http://wxPython.org

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

Which 2.8? It's working correctly here with 2.8.11.0.

···

On 10/23/10 2:02 PM, EJ Etherington wrote:

Ubuntu 9.04
Current .deb packages for that release.
wx is 2.8

--
Robin Dunn
Software Craftsman

Sorry for my late reply, I was out all last week.
Her is the output from the program on my devbox with the version string

etherine@devbox:~/ct_scripts/testscripts$ python progdial.py
wx.VERSION_STRING 2.8.9.1
(before) count: 1, keepGoing: True, skip: False
(after) count: 1, keepGoing: True, skip: True
(before) count: 2, keepGoing: True, skip: True
(after) count: 2, keepGoing: True, skip: True
(before) count: 3, keepGoing: True, skip: True
(after) count: 3, keepGoing: True, skip: True
(before) count: 4, keepGoing: True, skip: True
(after) count: 4, keepGoing: True, skip: True
(before) count: 5, keepGoing: True, skip: True
(after) count: 5, keepGoing: True, skip: True
(before) count: 6, keepGoing: True, skip: True
(after) count: 6, keepGoing: True, skip: True
(before) count: 7, keepGoing: True, skip: True
(after) count: 7, keepGoing: True, skip: True
(before) count: 8, keepGoing: True, skip: True
(after) count: 8, keepGoing: True, skip: True
(before) count: 9, keepGoing: True, skip: True
(after) count: 9, keepGoing: True, skip: True
(before) count: 10, keepGoing: True, skip: True
(after) count: 10, keepGoing: True, skip: True

[mailto:wxpython-users@googlegroups.com] On Behalf Of Robin Dunn

···

-----Original Message-----
From: wxpython-users@googlegroups.com
Sent: Monday, October 25, 2010 10:00 AM
To: wxpython-users@googlegroups.com
Subject: Re: [wxPython-users] ProgressDialog skip parameter always returns
True

On 10/23/10 2:02 PM, EJ Etherington wrote:

Ubuntu 9.04
Current .deb packages for that release.
wx is 2.8

Which 2.8? It's working correctly here with 2.8.11.0.

--
Robin Dunn
Software Craftsman

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

Below is the output from the program I listed before before and after
upgrading
I should stress that I never press the skip button...

etherine@devbox:~/ct_scripts/testscripts$ python progdial.py
wx.VERSION_STRING 2.8.9.1
(before) count: 1, keepGoing: True, skip: False
(after) count: 1, keepGoing: True, skip: True
(before) count: 2, keepGoing: True, skip: True
(after) count: 2, keepGoing: True, skip: True
(before) count: 3, keepGoing: True, skip: True
(after) count: 3, keepGoing: True, skip: True
(before) count: 4, keepGoing: True, skip: True
(after) count: 4, keepGoing: True, skip: True
(before) count: 5, keepGoing: True, skip: True
(after) count: 5, keepGoing: True, skip: True
(before) count: 6, keepGoing: True, skip: True
(after) count: 6, keepGoing: True, skip: True
(before) count: 7, keepGoing: True, skip: True
(after) count: 7, keepGoing: True, skip: True
(before) count: 8, keepGoing: True, skip: True
(after) count: 8, keepGoing: True, skip: True
(before) count: 9, keepGoing: True, skip: True
(after) count: 9, keepGoing: True, skip: True
(before) count: 10, keepGoing: True, skip: True
(after) count: 10, keepGoing: True, skip: True

etherine@devbox:~/ct_scripts/testscripts$ python progdial.py
wx.VERSION_STRING 2.8.11.0
(before) count: 1, keepGoing: True, skip: False
(after) count: 1, keepGoing: True, skip: True
(before) count: 2, keepGoing: True, skip: True
(after) count: 2, keepGoing: True, skip: True
(before) count: 3, keepGoing: True, skip: True
(after) count: 3, keepGoing: True, skip: True
(before) count: 4, keepGoing: True, skip: True
(after) count: 4, keepGoing: True, skip: True
(before) count: 5, keepGoing: True, skip: True
(after) count: 5, keepGoing: True, skip: True
(before) count: 6, keepGoing: True, skip: True
(after) count: 6, keepGoing: True, skip: True
(before) count: 7, keepGoing: True, skip: True
(after) count: 7, keepGoing: True, skip: True
(before) count: 8, keepGoing: True, skip: True
(after) count: 8, keepGoing: True, skip: True
(before) count: 9, keepGoing: True, skip: True
(after) count: 9, keepGoing: True, skip: True
(before) count: 10, keepGoing: True, skip: True
(after) count: 10, keepGoing: True, skip: True

[mailto:wxpython-users@googlegroups.com] On Behalf Of Robin Dunn

···

-----Original Message-----
From: wxpython-users@googlegroups.com
Sent: Monday, October 25, 2010 10:00 AM
To: wxpython-users@googlegroups.com
Subject: Re: [wxPython-users] ProgressDialog skip parameter always returns
True

On 10/23/10 2:02 PM, EJ Etherington wrote:

Ubuntu 9.04
Current .deb packages for that release.
wx is 2.8

Which 2.8? It's working correctly here with 2.8.11.0.

--
Robin Dunn
Software Craftsman

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

Ok, I think I see what's going on. The C++ code treats the skip parameter as InOut, but I'm wrapping it as if it's output only. In other words, the C++ code is using an uninitialized value for the skipped parameter. If there happens to be a true value in the memory location passed as the C++ skip parameter then that will cause the progress dialog to assume that skip was already set to false and will behave accordingly. On your system it appears that the memory location is not initialized to zero before being used, but on mine it is.

I should be able to fix this, but in the meantime you may want to not use the can_skip flag.

···

On 11/1/10 11:21 AM, EJ Etherington wrote:

Below is the output from the program I listed before before and after
upgrading
I should stress that I never press the skip button...

--
Robin Dunn
Software Craftsman

Hmm, interesting!
Alright, I won't use it I guess.

Thanks Robin

[mailto:wxpython-users@googlegroups.com] On Behalf Of Robin Dunn

···

-----Original Message-----
From: wxpython-users@googlegroups.com
Sent: Monday, November 01, 2010 5:54 PM
To: wxpython-users@googlegroups.com
Subject: Re: [wxPython-users] ProgressDialog skip parameter always returns
True

On 11/1/10 11:21 AM, EJ Etherington wrote:

Below is the output from the program I listed before before and after
upgrading
I should stress that I never press the skip button...

Ok, I think I see what's going on. The C++ code treats the skip
parameter as InOut, but I'm wrapping it as if it's output only. In
other words, the C++ code is using an uninitialized value for the
skipped parameter. If there happens to be a true value in the memory
location passed as the C++ skip parameter then that will cause the
progress dialog to assume that skip was already set to false and will
behave accordingly. On your system it appears that the memory location
is not initialized to zero before being used, but on mine it is.

I should be able to fix this, but in the meantime you may want to not
use the can_skip flag.

--
Robin Dunn
Software Craftsman

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

It will be fixed in the next 2.9.x release and in 2.8.12 if there is one.

···

On 11/2/10 9:49 AM, EJ Etherington wrote:

Hmm, interesting!
Alright, I won't use it I guess.

--
Robin Dunn
Software Craftsman