Writing app in XCode for OSX using OSX 10.8 SDK. All of my Windows work fine, until I use Interface Building to get rid of the title bar in the nib (I uncheck the Title Bar
param on the Attributes Inspector of the window element). The windows still show, but all the subviews are disabled. I can no longer input text and process bars are all greyed out.
Does anyone know why this is happening? and how to have a Window without a title bar, but with all subviews enabled?
Here is what my view looks like with a title bar:
And here's what it looks like without:
As you can see, everything is disabled.
Update
Someone asked about code to display windows. For this example I didn't use any code. For the two screens above here are the steps I followed:
Title Bar
attribute for the window.There is an answer for this question at this link:
Xcode 4, Cocoa Title bar removing from interface builders disables textView from editing
If you read the documentation for NSWindow you can see that the methods canBecomeKeyWindow and canBecomeMainWindow return NO if there is no title bar. Sub-classing NSWindow and over-riding these methods will make it so they can become key windows.
There is sample code on how to subclass these windows in apple's documentation website, or in xcode if you have documentation installed.
http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSWindow_Class/Reference/Reference.html#//apple_ref/occ/instm/NSWindow/canBecomeKeyWindow
Search for canBecomeKeyWindow in the above link and there will be sample code included that will help explain the process.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With