need an empty SpinCtrl

Using Phoenix I tried to create a SpinCtrl with its field empty.

wx.SpinCtrl(self, value='')

But this has no effect. There is always a '0' in the field.

This workaround doesn't work either.

wx.SpinCtrl(self, value='None')

Is there a way to get an really empty SpinCtrl?

I always tried
wx.SpinCtrl(self, value=None)
what gives me this error
overload 1: argument 1 has unexpected type 'NoneType'

The control should act less restrictive. When there is the "definied
nothing" then just display nothing. '0' is not nothing.

Would you accept an issue-ticket about it?

Another point would be that 'value' accept strings (means: don't give
an type exception about it) but doesn't display them in the control.

···

On 2015-04-11 00:45 <c.buhtz@posteo.jp> wrote:

Using Phoenix I tried to create a SpinCtrl with its field empty.

wx.SpinCtrl is intended to be used only with numbers so it is not too surprising that it must always have something that is a numeric value. If you want different behavior then you can use a wx.TextCtrl and a wx.SpinButton and process the spin button events as needed to update the associated textctrl in whatever way you want.

···

c.buhtz@posteo.jp wrote:

On 2015-04-11 00:45<c.buhtz@posteo.jp> wrote:

Using Phoenix I tried to create a SpinCtrl with its field empty.

I always tried
wx.SpinCtrl(self, value=None)
what gives me this error
overload 1: argument 1 has unexpected type 'NoneType'

The control should act less restrictive. When there is the "definied
nothing" then just display nothing. '0' is not nothing.

Would you accept an issue-ticket about it?

Another point would be that 'value' accept strings (means: don't give
an type exception about it) but doesn't display them in the control.

--
Robin Dunn
Software Craftsman

It is a design decision but there is no technical reason for this ctrl
to be so restrictive.

In that case more freedom to the user wouldn't create more work or
technical problems.

Maybe I want to count in alphabetical values A, B, C, D.
Or hexadicmal? Or numbers in another language 一二三四五 (japanese
kanji) etc.

···

On 2015-04-13 13:04 Robin Dunn <robin@alldunn.com> wrote:

wx.SpinCtrl is intended to be used only with numbers

I’m sure Robin would appreciate a patch that implements the functionality you seek.

:wink:

Cheers,

Scott.

···

On Sat, Apr 25, 2015 at 10:30 AM, c.buhtz@posteo.jp wrote:

On 2015-04-13 13:04 Robin Dunn robin@alldunn.com wrote:

wx.SpinCtrl is intended to be used only with numbers

It is a design decision but there is no technical reason for this ctrl

to be so restrictive.

In that case more freedom to the user wouldn’t create more work or

technical problems.

Maybe I want to count in alphabetical values A, B, C, D.

Or hexadicmal? Or numbers in another language 一二三四五 (japanese

kanji) etc.

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

This need to be done on the wxWidgets C++ side not here.

Btw: There is a open ticket about that problem
<wxTrac has been migrated to GitHub Issues - wxWidgets;

···

On 2015-04-25 10:58 grunculus <grunculus@gmail.com> wrote:

I'm sure Robin would appreciate a patch that implements the
functionality you seek.

That's true, but it wouldn't be too hard to make a pure python generic
control which has the characteristics you want.

···

On Sat, Apr 25, 2015 at 11:02 AM, <c.buhtz@posteo.jp> wrote:

On 2015-04-25 10:58 grunculus <grunculus@gmail.com> wrote:
> I'm sure Robin would appreciate a patch that implements the
> functionality you seek.

This need to be done on the wxWidgets C++ side not here.

--
Best Regards,
Michael Moriarity

I think you misread vadz comment in that ticket. I believe he thinks/says that it should always be '0' initialized, unless this is not the default behaviour of native implementations of SpinCtrl.

If you feel up to it to do it in Python you could look at http://wxpython.org/Phoenix/docs/html/lib.agw.floatspin.html#module-lib.agw.floatspin for inspiration.

In other words create a GenericSpinCtrl which could handle not only numeric values.

Werner

···

On 4/25/2015 17:02, c.buhtz@posteo.jp wrote:

On 2015-04-25 10:58 grunculus <grunculus@gmail.com> wrote:

I'm sure Robin would appreciate a patch that implements the
functionality you seek.

This need to be done on the wxWidgets C++ side not here.

Btw: There is a open ticket about that problem
<wxTrac has been migrated to GitHub Issues - wxWidgets;

I understood this very well. But please keep your comments about that
ticket inside the ticket to make it possible for all developers to
participate to the topic.

···

On 2015-04-25 17:36 Werner <wernerfbd@gmx.ch> wrote:

> <wxTrac has been migrated to GitHub Issues - wxWidgets;
I think you misread vadz comment in that ticket.