Feeds

Leopard pimpin' method madness

Surf the information super hierarchy

New hybrid storage solutions

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

Security for virtualized datacentres

More from The Register

next story
Not appy with your Chromebook? Well now it can run Android apps
Google offers beta of tricky OS-inside-OS tech
Greater dev access to iOS 8 will put us AT RISK from HACKERS
Knocking holes in Apple's walled garden could backfire, says securo-chap
NHS grows a NoSQL backbone and rips out its Oracle Spine
Open source? In the government? Ha ha! What, wait ...?
Google extends app refund window to two hours
You now have 120 minutes to finish that game instead of 15
Intel: Hey, enterprises, drop everything and DO HADOOP
Big Data analytics projected to run on more servers than any other app
New 'Cosmos' browser surfs the net by TXT alone
No data plan? No WiFi? No worries ... except sluggish download speed
prev story

Whitepapers

Providing a secure and efficient Helpdesk
A single remote control platform for user support is be key to providing an efficient helpdesk. Retain full control over the way in which screen and keystroke data is transmitted.
Top 5 reasons to deploy VMware with Tegile
Data demand and the rise of virtualization is challenging IT teams to deliver storage performance, scalability and capacity that can keep up, while maximizing efficiency.
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.
Security for virtualized datacentres
Legacy security solutions are inefficient due to the architectural differences between physical and virtual environments.
Secure remote control for conventional and virtual desktops
Balancing user privacy and privileged access, in accordance with compliance frameworks and legislation. Evaluating any potential remote control choice.