Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

contentView is always (0,0,0,0) when constructing panel #16

Open
adamgit opened this issue Aug 18, 2012 · 0 comments
Open

contentView is always (0,0,0,0) when constructing panel #16

adamgit opened this issue Aug 18, 2012 · 0 comments

Comments

@adamgit
Copy link

adamgit commented Aug 18, 2012

Customizing the panel fails in most cases because you cannot read the size of the content area.

Workaround:

  1. after instantiating the panel (initWithFrame:), add it to the target view
  2. call [panel layoutSubviews]; to force it to calculate its TRUE sizes
  3. 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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant