Forum Navigation
You need to log in to create posts and topics.

Re FBNS Full Screen

Posted by: fblistserve <fblistserve@...>

On Feb 7, 2013, at 4:25 PM, Deep <Info@ScorpionResearch.com> wrote:

> In Cocoa, how does one do the equivalent? In Xcode it is a simple tick box on the Interface Builder but how does one adapt FBNS to achieve it programmatically?

in the FBNS demo ( project version ):

fn FBNSWindowCreate creates an FBNSWIndow which is an NSWindow( it is really a wrapper class that subclasses NSWindow ) utilizing some of the NSWindowDelegate calls primarily for the callback. So, since this is an NSWindow, it should respond to all the usual calls such as the toggleFullScreen: method and the NSWindowDelegate calls for full screen ( such as customWindowsToEnterFullScreenForWindow: etc. ). Method calls that are already available to an NSWindow may be invoked directly but the NSWindowDelegate calls would have to be defined in the same way Bernie has defined the other delegate calls with callbacks. This is a little more work because FBNS is based on mapping the Cocoa code to procedural type callbacks. If I have time tomorrow I’ll see about actual code. Keep in mind Bernie’s code is almost 100% Cocoa at its core with procedural wrappers. The carbon event loop could easily be removed by relocating FBNSApplicationLoad() out of fn Init() with something like( untested but should be close ):

//RunApplicationEventLoop()

#if 0// Carbon

fn FBNSApplicationLoad()
fn Init()
RunApplicationEventLoop()

#else// Cocoa

dim as FBNSApplicationRef app
app = fn FBNSApplicationGetSharedApplication()
fn Init()
FBNSApplicationActivateIgnoringOtherApps( app, _true )
FBNSApplicationRun( app )

#endif

Brian S.