Feeds

Leopard pimpin' method madness

Surf the information super hierarchy

Choosing a cloud hosting partner with confidence

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

Secure remote control for conventional and virtual desktops

More from The Register

next story
ONE MILLION people already running Windows 10
A third of them are doing it in VMs, but early feedback focuses on frippery
Sign off my IT project or I’ll PHONE your MUM
Honestly, it’s a piece of piss
Netscape Navigator - the browser that started it all - turns 20
It was 20 years ago today, Marc Andreeesen taught the band to play
Torvalds CONFESSES: 'I'm pretty good at alienating devs'
Admits to 'a metric ****load' of mistakes during work with Linux collaborators
Sway: Microsoft's new Office app doesn't have an Undo function
Content aggregation, meet the workplace ... oh
Do Moan! MONSTER 6-day EMAIL OUTAGE hits Domain Monster
Customers freaked out by frightful service
Ploppr: The #VultureTRENDING App of the Now
This organic crowd sourced viro- social fertiliser just got REAL
Return of the Jedi – Apache reclaims web server crown
.london, .hamburg and .公司 - that's .com in Chinese - storm the web server charts
NetWare sales revive in China thanks to that man Snowden
If it ain't Microsoft, it's in fashion behind the Great Firewall
prev story

Whitepapers

Forging a new future with identity relationship management
Learn about ForgeRock's next generation IRM platform and how it is designed to empower CEOS's and enterprises to engage with consumers.
Win a year’s supply of chocolate
There is no techie angle to this competition so we're not going to pretend there is, but everyone loves chocolate so who cares.
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.
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?
Saudi Petroleum chooses Tegile storage solution
A storage solution that addresses company growth and performance for business-critical applications of caseware archive and search along with other key operational systems.