As a matter of fact, under the hood, events are signals, and they are indeed received. However, in Xojo, we tend to take the event handler for the actual event. Hence perhaps the idea that events are generated.
I think raised is the preferred term.
Since Window.opening happens after controls have been instantiated, even if you modify controls properties, you are fine.
However, in controls Opening event, one should refrain from addressing other controls, because they may not have been instantiated yet.
Just FYI, LostFocus cannot be cancelled. Coding by focus events is fraught with peril.
Sure, cancel a moving focus canāt in Xojo. But moving the focus can be overridden moving the focus back to the current control with a setfocus in the LostFocus event.
But then youāve got a GotFocus and LostFocus on the other control, plus a GotFocus on the original control to deal with. It gets tricky.
Sadly, but as I said, and this is the important part, must obey such order in any GUI, you canāt ENTER a place before LEAVING the previous place.
That part isnāt documented, I donāt think, but Xojo does raise LostFocus on the first control before GotFocus on the next. Thatās probably worth a mention somewhere in the documentation, if itās not already there.
I Joe.LostFocus() 23 replies agoā¦
Sorry, couldnāt resist.
As it should, in any event driven GUI system, as I said. The system isnāt chaotic. There are places where orders and cascades MUST exist. Events are queued and the event loop gets them in that order.