wx.SpinCtrl bug on OS X?

SpinCtrl's do not seem to show their initial values on OS X. The
attached code displays an empty box until the value is changed on OS
X, but will correctly display the initial value on both Linux and
Windows.

Explicitly setting a value with .SetValue(x) seems to be a workaround,
but I'd rather not have to add a bunch of these to make the app I'm
working on behave correctly. It's surely possible I'm just doing
something wrong, as I'm new to wxPython.

My test environment is OS X 10.6.3 with python 2.6.5 and wxPython
2.8.10.1. I also tried a prerelease 2.9 version from 20100122 with the
same results.

Thoughts?

--Adam

SpinCtrlBug.py (407 Bytes)

If one of the Mac guys doesn't have any ideas, you could always try
the FloatSpin widget...

···

On Mar 31, 10:12 pm, Adam Caldwell <adam.caldw...@gmail.com> wrote:

SpinCtrl's do not seem to show their initial values on OS X. The
attached code displays an empty box until the value is changed on OS
X, but will correctly display the initial value on both Linux and
Windows.

Explicitly setting a value with .SetValue(x) seems to be a workaround,
but I'd rather not have to add a bunch of these to make the app I'm
working on behave correctly. It's surely possible I'm just doing
something wrong, as I'm new to wxPython.

My test environment is OS X 10.6.3 with python 2.6.5 and wxPython
2.8.10.1. I also tried a prerelease 2.9 version from 20100122 with the
same results.

Thoughts?

--Adam

SpinCtrlBug.py

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org

Try adding value='50' to the parameters passed to the constructor.

···

On 3/31/10 8:12 PM, Adam Caldwell wrote:

SpinCtrl's do not seem to show their initial values on OS X. The
attached code displays an empty box until the value is changed on OS
X, but will correctly display the initial value on both Linux and
Windows.

Explicitly setting a value with .SetValue(x) seems to be a workaround,
but I'd rather not have to add a bunch of these to make the app I'm
working on behave correctly. It's surely possible I'm just doing
something wrong, as I'm new to wxPython.

My test environment is OS X 10.6.3 with python 2.6.5 and wxPython
2.8.10.1. I also tried a prerelease 2.9 version from 20100122 with the
same results.

--
Robin Dunn
Software Craftsman

This seems to work in a cross-platform-happy way. Thanks.

--Adam

···

On Apr 1, 10:42 am, Robin Dunn <ro...@alldunn.com> wrote:

On 3/31/10 8:12 PM, Adam Caldwell wrote:

> SpinCtrl's do not seem to show their initial values on OS X. The
> attached code displays an empty box until the value is changed on OS
> X, but will correctly display the initial value on both Linux and
> Windows.

> Explicitly setting a value with .SetValue(x) seems to be a workaround,
> but I'd rather not have to add a bunch of these to make the app I'm
> working on behave correctly. It's surely possible I'm just doing
> something wrong, as I'm new to wxPython.

> My test environment is OS X 10.6.3 with python 2.6.5 and wxPython
> 2.8.10.1. I also tried a prerelease 2.9 version from 20100122 with the
> same results.

Try adding value='50' to the parameters passed to the constructor.

--
Robin Dunn
Software Craftsmanhttp://wxPython.org