LEDNumberCtrl

Zunbeltz wrote:

Hi,

I'm trying the LEDNumberCtrl gizmo. I can't use it to print float because
i get the following error

  File "/usr/local/lib/python2.3/site-packages/wxPython/gizmos.py", line
264, in SetValue
    val = gizmosc.wxLEDNumberCtrl_SetValue(self, *_args, **_kwargs)
wxPython.wxc.wxPyAssertionError: C++ assertion "(ch>='0' && ch<='9') ||
ch=='-' || ch==' '" failed in
contrib/gizmos/contrib/src/gizmos/ledctrl.cpp(143): wxLEDNumberCtrl can
only display numeric string values.

My wxPython version is 4.2.

Somebody knows what can I do to display floats with LED style.

It would require updating the LEDNumberCtrl C++ code to support displaying the decimal point. OTOH, the LEDNumberCtrl code is pretty simple, it would not be hard to port it to Python and then add the functionality you need.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!