Quote:
Originally Posted by Hezzy002
PHP Code:
temp.lastFocus = GraalControl;
for (c : GraalControl.controls) {
if (c.isFirstResponder()) {
temp.lastFocus = c;
break;
}
}
//Create GUIControl
temp.lastFocus.makeFirstResponder(true);
I figured that would be a better way. Is that more reliable (i.e. works with chatbar and other GUIControls), or can more than one object return true from isFirstResponder()?
|
That would only check the first children of GraalControl, so, for example, a button inside a window would not be checked.
If it's absolutely necessary, I'd do something like this.
PHP Code:
function onFirstResponderChanges(temp.obj) {
if (temp.obj.dontStealFocus) {
this.lastResponder.makeFirstResponder(true);
} else {
this.lastResponder = temp.obj;
}
}
Then you could just set
dontStealFocus on any GUI control and it wouldn't steal focus.