osx - How do I do something after the next NSView -layout has occurred? -


in response user event, want to:

  • add new nsview window, , then
  • show nspanel positioned below view

i have each half of done. can add new subview, , container view's -updateconstraints identifies , adds correct layout constraints, next time layout performed, it's positioned correctly in window. also, have nswindowcontroller subclass puts panel on screen.

unfortunately, there's ordering problem. panel's controller looks @ new nsview's frame property deciding put it, during iteration of main event loop, -layout method hasn't been called yet, it's still positioned @ (0,0).

(if separate these 2 pieces of functionality, , require 2 separate user events "add view" , "create panel", panel correctly positioned below view.)

is there way attach nspanel nsview, if layout constraint? or there way "do (window controller stuff), after next -layout call"?

just call -layoutsubtreeifneeded on nsview’s superview add , constraints, lay out immediately, add panel.

or use nspopover, although draw way , might not want that.


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -