TGNumberEntry Signals?

Hi,

I have a GUI that updates every 0.2 seconds with real time magnet currents. When a user has the mouse cursor in a TGNumberEntry widget I don’t want that particular widget to update ( it will overwrite the values the user is typing).

Is there a signal that is emitted when the cursor is in a TGNumberEntryField that i can use to temporarily turn of updating ? I’m sure there must be, but i’ve not succeeded in finding it.

In general is there a single place I can find all the different GUI widget signals available in Root?

many thanks in advance,

Duncan

Hi Duncan,

You can use the ProcessedEvent(Event_t*) signal. Here is an example:

[...]
   fNumberEntry->GetNumberEntry()->Connect("ProcessedEvent(Event_t*)", "MyMainFrame",
                                           this, "NumberEntryEvent(Event_t*)");
[...]

void MyMainFrame::NumberEntryEvent(Event_t *ev)
{
   if (ev->fType == kEnterNotify) {
      std::cout << "Entering the TGNumberEntry..." << std::endl;
      fUserInput = kTRUE;
   }
   if (ev->fType == kLeaveNotify) {
      std::cout << "Leaving the TGNumberEntry..." << std::endl;
      fUserInput = kFALSE;
   }
}

[quote=“djs56”]In general is there a single place I can find all the different GUI widget signals available in Root?[/quote]Well, no, but you can grep for [color=#0000FF]//SIGNAL[/color] in the include directory…

Cheers, Bertrand.

Hi,

Thanks for the help,

Actually, what I wanted was not when the mouse was over the TGNumberEntryField, but when the “cursor” was in the entry box so you could type in a new value, maybe I wasn’t using the correct language?

I solved my problem by changing kEnterNotify and kLeaveNotify to kFocusIn and kFocusOut from your suggested code.

Also finding the file GuiTypes.h has been very useful.

Thanks again for your help,

Duncan