Pierre Bernard

My little hideout on the net

HHValidatedButton: User interface validation for NSButton

According to the Cocoa User Interface Validation documentation: "The protocols NSUserInterfaceValidations and NSValidatedUserInterfaceItem provide a standard way to validate user interface items—that is, to set their state as appropriate for the current application context".

Unfortunately, automatic user intreface validation is provided only for menu items and toolbar items. Wouldn't it be great if NSButton could also benefit from this set-up?

That's what HHValidatedButton implements. It is a drop-in subclass of NSButton. It channels validation through validateButton: and validateUserInterfaceItem:.
Comments (2)