Is it possible to have a blank TGNumberEntry?

I have TGNumberEntry widgets used for operator input.

Sometimes, the widgets are disabled to disallow any operator input, via SetEnabled(kFALSE). In this case, the widget still displays the current number value (with grey background to indicate disabled).

In the disabled case, I would like to not display a number value, but just display spaces/blanks/an empty field.

What I do now is, set the text color to the background color of the widget, which effectively makes the number ‘invisible’.

Any thoughts on a better way to do this?

Hi,

You can try to use:

But this will clear the value itself, so you will have to remember the value and set it back when re-enabling the number entry.
Anyway, I personally think it is better to keep the value visible, even when the number entry is disabled…

Cheers, Bertrand.