Mostly undocumented stuff

NSOpenGLView and NSToolbar issue

For a long time, I’d run to the same problem with projects that included a window containing a full-window NSOpenGLView and a toolbar. In the Interface Builder, the NSToolbar controls open behind the OpenGL view and are unusable.

There is a simple, although kludgy, way around this:
Set the NSOpenGLView hidden in the View settings of the control. Then, add a line to your window controller’s awakeFromNib method:
-(void)awakeFromNib {
[[self glview] setHidden:NO]; // glview is the NSOpenGLView control
}

Result: You can still control the view inside the window normally in Interface Builder, but NSToolbar opens on top, the OpenGLView still opens up normally, and everybody is happy.

Tweet

Share this:

  • Click to share on Twitter (Opens in new window)
  • Share on Facebook (Opens in new window)
  • Click to share on Google+ (Opens in new window)

Leave a Reply Cancel reply

*

*


gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.