TGNumberEntry Loosing Focus callback

What method should I be using to trap a loosing focus in a TGNumberEntry dialog? It appears that ValueSet only is called when using the spin buttons or
when return is hit inside the number entry field.

I can’t figure out what causes the ValueChanged event.

Thanks
Chris

Hi Chris,

What do you mean by ‘loosing focus’? Testing Number Entry dialog of guitest.C I see that if I click on a number entry field, the blinking cursor remains there until I click somewhere else.

[quote]It appears that ValueSet only is called when using the spin buttons or when return is hit inside the number entry field. [/quote]Yes, that is the functionality we have.

[quote]I can’t figure out what causes the ValueChanged event.[/quote]The ValueChanged signal is sent when the data member fButtonToNum is set to kFALSE (default is kTRUE). In this case the the parent widget is responsible to change the numerical value into number entry field. As the comments of TGNumberEntry::SetButtonToNum say " This can be useful to implement cursors, which move from data point to data point."

Cheers, Ilka

In the old X/Motif style it was possible to create a losing focus callback.

This is much like Focus Follows Mouse on the server side. The behaviour you outline is correct, I was wondering if I could get the same callback when I move the mouse out of the input box.

However, in writing that to you, I can see a plethora of bad things happening. So, it isn’t really a good idea.

Thanks for the conversation.
Chris