Feeds

Leopard pimpin' method madness

Surf the information super hierarchy

Build a business case: developing custom apps

However, you'll notice that NSFrameView implements a method called _shadowType, which returns a bit-mask; effectively, an integer between 0 and 31. Leopard uses subtly different shadowing effects depending whether the window is a utility window, a sheet, or a normal window, whether it is opaque, is the key window, and so on.

What if you want your app to really, er, stand out from the crowd? Do you remember some earlier betas of Leopard? One release had a much more forceful looking window shadow than currently used. If you want to experiment with this, sub-classing the window frame is, once again, the only way to travel. Take a look at the following code:



- (void) _setShadowParameters
{
        extern OSStatus CGSSetWindowShadowAndRimParameters (void * cid, int wid, 
                  float standardDeviation, float density, 
                  int offsetX, int offsetY, unsigned int flags);
        
        int stype;
        if ((stype = [self _shadowType]) != [self shadowState])
        {
                [self setShadowState: stype];
                CGSSetWindowShadowAndRimParameters ([NSApp contextID], 
                                           [_window windowNumber], 
                                           35.0, 0.75, 0, 28, 0);
        }
}

The _setShadowParameters method is called, as needed, to set the shadow parameters associated with the window. Normally, this method looks at the type of window and sets the appropriate type of shadow. Here, we've overridden that behaviour and used the undocumented GSSetWindowShadowAndRimParameters routine to give the window a much more imposing screen presence!

You'll find that it's possible to push the standardDeviation and density values quite a bit higher than I've done, but don't go mad or you'll get unpleasant boundary effects appearing. You have been warned!

As ever, you can download the demo application and source code here

Boost IT visibility and business value

More from The Register

next story
The Return of BSOD: Does ANYONE trust Microsoft patches?
Sysadmins, you're either fighting fires or seen as incompetents now
Microsoft refuses to nip 'Windows 9' unzip lip slip
Look at the shiny Windows 8.1, why can't you people talk about 8.1, sobs an exec somewhere
Intel's Raspberry Pi rival Galileo can now run Windows
Behold the Internet of Things. Wintel Things
Linux Foundation says many Linux admins and engineers are certifiable
Floats exam program to help IT employers lock up talent
Microsoft cries UNINSTALL in the wake of Blue Screens of Death™
Cache crash causes contained choloric calamity
Eat up Martha! Microsoft slings handwriting recog into OneNote on Android
Freehand input on non-Windows kit for the first time
Linux kernel devs made to finger their dongles before contributing code
Two-factor auth enabled for Kernel.org repositories
prev story

Whitepapers

Implementing global e-invoicing with guaranteed legal certainty
Explaining the role local tax compliance plays in successful supply chain management and e-business and how leading global brands are addressing this.
7 Elements of Radically Simple OS Migration
Avoid the typical headaches of OS migration during your next project by learning about 7 elements of radically simple OS migration.
BYOD's dark side: Data protection
An endpoint data protection solution that adds value to the user and the organization so it can protect itself from data loss as well as leverage corporate data.
Consolidation: The Foundation for IT Business Transformation
In this whitepaper learn how effective consolidation of IT and business resources can enable multiple, meaningful business benefits.
High Performance for All
While HPC is not new, it has traditionally been seen as a specialist area – is it now geared up to meet more mainstream requirements?