I am currently pondering about the possibility of creating easy setups for custom MacOSLib classes.
For example the NSButton Class uses a NSButtonCell object by default as physical representation, and by getting the pointer to its representation I can change its properties which lead to some style that are not possible by using the NSButton properties and methods alone, like in this example for a (very big) InlineBezelStyle Button with a ButtonCell BackGroundStyleDark (which makes it appear bright instead of dark gray).
In order to change the background color of the ButtonCell, one would have to implement the setBackgroundColor method which is by default instanced in NSTextFieldCell, which is a subclass of NSActionCell which in turn is a subclass of NSCell. The default, NSButtonCell, is a subclass of NSActionCell too, so they are sisters by being different branches of the same superclass.
I tried to implement setBackgroundColor to NSButtonCell but this brings no changes to the representation.
I read that I can change the type of ButtonCell by invoking NSControls shared setCellclass method, (NSButton being a subclass of NSControl), but according to Apple this can only be done successfully during the AwakeFromNib method. Therefore I wonder if AwakeFromNib is the event that is translated to Xojos Open event. I tried to implement a setCellClass call in the open event, setting the cellclass of a NSButton to NSTextFieldCell class, but while this causes no errors it also creates no changes.
Anyone of you having ideas if this would be possible at all or if one would have to set up custom classes completely which init and mount a different cellclass by allocating, initializing and all that from the constructor?