Feeds

New vistas with windows frames

Open your mind

Intelligent flash storage arrays

In the same vein, there's another method, _setUtilityWindow: that will enable you to turn a regular window into a utility window, or vice versa. Frankly, I can't see why you would ever want to do this, and it would confuse the hell out of the user, so this one's best avoided!

Cocoa window with padlock

The lock of love: work with showsLockButton

Although not strictly part of the frame view functionality, another useful trick is to be able to display the little "padlock" icon in the top-right corner of a window, just like Safari does when accessing a secure site. I've seen several Cocoa developers ponder how to do this on the web. The NSWindow class implements an undocumented method called showsLockButton. If this method returns YES, then a lock icon will be displayed.

In order to change the state of this on the fly, though, you'll need to "nudge" the frame view object to let it know that the buttons should be updated. This is accomplished as below:

 


[[self _borderView] _updateButtons];

If you want to know when the lock button was clicked, add a lockButtonClicked: method to your window class. It would be nice if you could easily customise the lock button's icon for other purposes, but that's beyond the scope of this article.

To access the real power of what's available here, we need to create our own custom subclass NSThemeFrame, and associate it with the application window. We do this by providing a special method on the window class, frameViewClassForStyleMask, which returns the custom frame view class we want to use. This method is called periodically by the guts of the NSWindow code whenever it needs to access the window's frame view - usually to establish geometry.

Next month, I'll be looking in more detail at what can be done through the provision of a custom border view. Until then, take a look see at how easy it is to drastically alter the appearance of a window simply by overriding the contentAlpha and contentFill methods. You can download the demo application and source code, mentioned earlier, here

Providing a secure and efficient Helpdesk

More from The Register

next story
Preview redux: Microsoft ships new Windows 10 build with 7,000 changes
Latest bleeding-edge bits borrow Action Center from Windows Phone
Google opens Inbox – email for people too thick to handle email
Print this article out and give it to someone tech-y if you get stuck
Microsoft promises Windows 10 will mean two-factor auth for all
Sneak peek at security features Redmond's baking into new OS
FTDI yanks chip-bricking driver from Windows Update, vows to fight on
Next driver to battle fake chips with 'non-invasive' methods
UNIX greybeards threaten Debian fork over systemd plan
'Veteran Unix Admins' fear desktop emphasis is betraying open source
Entity Framework goes 'code first' as Microsoft pulls visual design tool
Visual Studio database diagramming's out the window
Google+ goes TITSUP. But WHO knew? How long? Anyone ... Hello ...
Wobbly Gmail, Contacts, Calendar on the other hand ...
prev story

Whitepapers

Why cloud backup?
Combining the latest advancements in disk-based backup with secure, integrated, cloud technologies offer organizations fast and assured recovery of their critical enterprise data.
A strategic approach to identity relationship management
ForgeRock commissioned Forrester to evaluate companies’ IAM practices and requirements when it comes to customer-facing scenarios versus employee-facing ones.
Security for virtualized datacentres
Legacy security solutions are inefficient due to the architectural differences between physical and virtual environments.
Reg Reader Research: SaaS based Email and Office Productivity Tools
Read this Reg reader report which provides advice and guidance for SMBs towards the use of SaaS based email and Office productivity tools.
New hybrid storage solutions
Tackling data challenges through emerging hybrid storage solutions that enable optimum database performance whilst managing costs and increasingly large data stores.