Mixing Juce and Mac Native UI?


#1

Hello,

Is possible to use some UI effect and component from Cocoa or any native Mac api ?

This is a very global answer, o.c.

I was wndering if to make some flip effect as on the iphone, it is better to code your own ni Juce, or if importing from mac api is possible, e.g,

thanks

asr


#2

You might be able to apply something to the whole NSWindow, but I don’t really know how that stuff works.


#3

A mac-centric way…

http://cocoaconvert.net/2009/05/24/flippin-modal-panels/

Something like this in your component .mm (or in xcode get info on the source file and force objective c++ compilation)

NSWindow *w;
ComponentPeer *componentPeer=getPeer();
jassert(componentPeer);
NSView* const peer = (NSView*) (componentPeer->getNativeHandle());
if (peer && (w=[peer window]))
{
 [w flipMe]; // I dunno if the above link extends NSWindow via a category...see below
}

// example of extending NSWindow
@implementation NSWindow(WindowFlipperExt)
-(void)flipMe
{
 // code to flip the window
}

@end

#4

Hey, thank you :slight_smile: