Customizing the panel fails in most cases because you cannot read the size of the content area.
Workaround:
after instantiating the panel (initWithFrame:), add it to the target view
call [panel layoutSubviews]; to force it to calculate its TRUE sizes
run the customization code
NB: this means you must not put your panel-contents-code into "initWithFrame:" - because during that method you have no way to get your sizes correct ... unless it's safe to call layoutSubviews inside the constructor?
(your example panel ignores sizes, so doesn't have this problem)
Customizing the panel fails in most cases because you cannot read the size of the content area.
Workaround:
NB: this means you must not put your panel-contents-code into "initWithFrame:" - because during that method you have no way to get your sizes correct ... unless it's safe to call layoutSubviews inside the constructor?
(your example panel ignores sizes, so doesn't have this problem)