How to Update the Default OK/Cancel button dynamically

Odd. It is becoming customary to dynamically adjust which dialog box dismissal button (OK/Cancel for Windows or Cancel/OK for OS X viewing them left to right on a dialog canvas). While maintaining focus on another UI control, text box, I want to disable the OK button if the text field changes to a null field and then re-enable once the text field as text exists. Consequently, I want to make the Cancel or OK the default so that the user can press the Enter key to accept the text input (or to cancel if there is no text entry).

Pretty simple in concept and streamlines the UI possibly removing a tab or additional mouse click.

I’ve “wired” the text box control’s TextChange event handler to check and set the OK/Cancel buttons accordingly. Windows it works fine, just as expected. However, in OS X when the OK becomes the default instead of the original Cancel being the default, the Cancel button goes completely white. That might be because in OS X the default is white text on a blue button and I’m wondering if when I set the Cancel button’s Default property to False and OK property to True that the Cancel’s button text is still white?

Have any of you seen this before? I tried to find a good example in the latest Xojo 2014 R3.1 examples and couldn’t find one.

I am having a similar problem. I upgraded to Xojo and imported a project into 2013 R3.3 (Mac) and all buttons that were labeled as “default” and had the bold property set, the button text went white (on a white background). They were not doing this prior to the import/upgrade. At first I though that it was setup that way in the OS’s System Preferences but I could not find a setting to correct it. Has anyone else seen this?

Mac OS X 10.10

[quote=154179:@Howard Whitaker]
I’ve “wired” the text box control’s TextChange event handler to check and set the OK/Cancel buttons accordingly. Windows it works fine, just as expected. However, in OS X when the OK becomes the default instead of the original Cancel being the default, the Cancel button goes completely white.[/quote]
You’re trying this on 10.10 aren’t you ?
Not sure why but thats the only place this appears to happen
10.7, 10.8, 10.9 and 10.11 dont so it may in fact be a bug in OS X
Not sure if we can work around this as its definitely a very odd appearance

I filled a feedback about that last year …

<https://xojo.com/issue/37789>