ProgressDialog skip parameter always returns True

29 views
Skip to first unread message

EJ

unread,
Oct 22, 2010, 6:10:23 PM10/22/10
to wxPython-users
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]

Robin Dunn

unread,
Oct 23, 2010, 3:21:36 PM10/23/10
to wxpytho...@googlegroups.com
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

EJ Etherington

unread,
Oct 23, 2010, 5:02:17 PM10/23/10
to wxpytho...@googlegroups.com
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.

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

Robin Dunn

unread,
Oct 25, 2010, 1:00:28 PM10/25/10
to wxpytho...@googlegroups.com
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.

EJ Etherington

unread,
Nov 1, 2010, 12:54:02 PM11/1/10
to wxpytho...@googlegroups.com
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

--

EJ Etherington

unread,
Nov 1, 2010, 2:21:02 PM11/1/10
to wxpytho...@googlegroups.com
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

--

Robin Dunn

unread,
Nov 1, 2010, 8:54:07 PM11/1/10
to wxpytho...@googlegroups.com
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.

EJ Etherington

unread,
Nov 2, 2010, 12:49:37 PM11/2/10
to wxpytho...@googlegroups.com
Hmm, interesting!
Alright, I won't use it I guess.

Thanks Robin

-----Original Message-----
From: wxpytho...@googlegroups.com
[mailto:wxpytho...@googlegroups.com] On Behalf Of Robin Dunn
Sent: Monday, November 01, 2010 5:54 PM
To: wxpytho...@googlegroups.com
Subject: Re: [wxPython-users] ProgressDialog skip parameter always returns
True

--

Robin Dunn

unread,
Nov 2, 2010, 7:15:31 PM11/2/10
to wxpytho...@googlegroups.com
On 11/2/10 9:49 AM, EJ Etherington wrote:
> Hmm, interesting!
> Alright, I won't use it I guess.

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

Reply all
Reply to author
Forward
0 new messages