On Apr 22, 2012, at 12:45 AM, SVanVoorst wrote:


What's the equivalent FBtoCocoa 1.0a4 Acorn here?
'-------- start ------- 

If you are not using NSLog.incl, I highly recommend it.  There should be a copy on this site or you can get it from Bernie.  It is indispensable for debugging.

Steve Van Voorst 

Super Duper. Not sure if it's the metaphorical acorn I had in mind, I could tell you what one example of that might be offlist, but it's another fine seed, thank you. Appreciate all the seeds you've written, they are great building blocks. I learn a lot from them.

That takes care of debugging aids. :) Next up, NSTextField. http://www.cocoadev.com/index.pl?NSTextField
 
(Anyone needing NSLog.incl can get out of FBNSLog Demo posted March 6 to this list)  here  http://freegroups.net/groups/fbcocoa/www/FB/Debug/FBNSLog.zip

Groovage. Here's a static Edit Field. Hmm, how might we map that to new statement, Cocoa Edit Field FB statement?

Seems possible. I see spare parts a plenty which can be drive our current keywords.
 
http://stackoverflow.com/questions/1507644/sample-code-for-creating-a-nstextfield-label
 
Lookee! Thar be Edit fields in a Cocoa window, easy peasy.

Accessing it later for changing, accessing any existing object -later- for changing, using their methods, -that- is the crux, the acorn still to be gnawed.

Roberto


NSTextField *textField;

    textField = [[NSTextField alloc] initWithFrame:NSMakeRect(10, 10, 200, 17)];
    [NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:[[textField cell] controlSize]]];
    [textField setStringValue:@"My Label"];
    [textField setBezeled:NO];
    [textField setDrawsBackground:NO];
    [textField setEditable:NO];
    [textField setSelectable:NO];
    [[window contentView] addSubview:textField];


'-------- start -------



include "NSLog.incl"

BeginCFunction
void TEST(void)
{
  NSLog(@"begins with");
}

void DOSTUFF(void)
{
  NSLog(@"longest journey");
  TEST();
}
EndC

BeginCCode
{
 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc]init];
 [NSApplication sharedApplication];
 [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];

// ------ Menubar ------- //
 id menubar = [[NSMenu new] autorelease];
 id appMenuItem = [[NSMenuItem new] autorelease];
 [menubar addItem:appMenuItem];
 [NSApp setMainMenu:menubar];

// ------ Menu ------- //
 id appMenu = [[NSMenu new] autorelease];
 id quitMenuItem = [[[NSMenuItem alloc] initWithTitle:@"Quit"
        action:@selector(terminate:) keyEquivalent:@"q"] autorelease];
 [appMenu addItem:quitMenuItem];
 [appMenuItem setSubmenu:appMenu];

// ------ Window ------- //
 #define _wndW  430
 #define _wndH  300
 id window = [ [ NSWindow alloc ] 
                       initWithContentRect:NSMakeRect( 0, 0, _wndW, _wndH )
                       styleMask: NSClosableWindowMask | NSTitledWindowMask
                       backing:NSBackingStoreBuffered
                       defer:YES];
 [window center];
 [window setTitle: @"NSWindow" ];
 [window makeKeyAndOrderFront:nil]; 


NSTextField *textField;

    textField = [[NSTextField alloc] initWithFrame:NSMakeRect(10, 10, 200, 17)];
    [NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:[[textField cell] controlSize]]];
    [textField setStringValue:@"My Label"];
    [textField setBezeled:NO];
    [textField setDrawsBackground:NO];
    [textField setEditable:NO];
    [textField setSelectable:NO];
    [[window contentView] addSubview:textField];

 NSLog(@"Even the");
 DOSTUFF();
 NSLog(@"an acorn.");

 [NSApp activateIgnoringOtherApps:YES];
 [NSApp run];
 [pool drain];
}
EndC

'------- end -------

--
To unsubscribe, send ANY message to: futurebasic-unsubscribe@... To access the list archives, go to: http://freegroups.net/groups/futurebasic/