News:

Marketplace board now live! Post those eBay finds!

Main Menu

Recent posts

#11
Software / Re: How to get Tiny.m by Simso...
Last post by ptek - Sep 26, 2025, 02:55 AM
Quote from: jeffburg on Sep 25, 2025, 02:09 PMI'm glad it works! And yeah, great catch! I totally missed it! NSBezierPath was introduced in OSX, so it won't work in OpenStep.
Interesting, is NSBezierPath() a commonly used function on OSX? I wonder if that function is in Rhapsody DR2?

Quote from: jeffburg on Sep 25, 2025, 02:09 PMBut yeah, think of the code troubleshooting like you would hardware troubleshooting. For example, if the computer won't boot and the error is related to RAM failure... what do you do first? Remove all the RAM except for 1 stick and boot again. If it boots, you put in another stick and try again. If it boots again you put in another stick of RAM over and over until it stops booting. Then you have found your bad stick of RAM.

Then when you master this technique you move on to the next technique which is split-half search. Remove half of the RAM and boot the computer. If it boots up, then you put all the RAM back and remove the other half. Then it should fail to boot, and you remove half of the remaining RAM and see if it boots. By moving back and forth in halves instead of 1 at a time, you double your troubleshooting speed ;)

https://www.oreilly.com/library/view/apple-training-series/0321335465/0321335465_ch03lev1sec3.html

  Thank you for taking the time into having a quick look into this :) I was looking for a example that doesn't use .nib files as I like to keep both options available it's also good as when people open the .app file and don't see any .nib files it will be harder for them to disassemble. Not that I code anything advanced  ;D

  But I know that menus will need to be done via Interface Builder.

  I still need to finish of the program and get something to display but as posted earlier the Red Rectangle code works.
#12
Hardware / Re: NeXTDimension VRAM error
Last post by andreas_g - Sep 25, 2025, 05:11 PM
I just had a closer look but unfortunately I cannot link the error message to a certain hardware failure. I think it means that one or all VRAM modules are bad. But it also might be something else.

Out of interest I tested how much RAM is necessary to run an ND board. It works with a minimum of 4 MB RAM (not to confuse with the 4 MB of VRAM on the board).
#13
Hardware / Re: NeXTDimension VRAM error
Last post by andreas_g - Sep 25, 2025, 02:19 PM
The NeXTdimension board had 4 MB of VRAM and up to 64 MB of RAM. The amount of VRAM was not configurable. I'll check if I can find out some more things. But I think it might be hard to find out which chip or whatelse is broken just from this error message.
#14
Hardware / Re: NeXTDimension VRAM error
Last post by jeffburg - Sep 25, 2025, 02:12 PM
Thats a good point actually, was this known to be working before? Then you would at least know its a hardware failure rather than a configuration failure.
#15
Software / Re: How to get Tiny.m by Simso...
Last post by jeffburg - Sep 25, 2025, 02:09 PM
I'm glad it works! And yeah, great catch! I totally missed it! NSBezierPath was introduced in OSX, so it won't work in OpenStep.

But yeah, think of the code troubleshooting like you would hardware troubleshooting. For example, if the computer won't boot and the error is related to RAM failure... what do you do first? Remove all the RAM except for 1 stick and boot again. If it boots, you put in another stick and try again. If it boots again you put in another stick of RAM over and over until it stops booting. Then you have found your bad stick of RAM.

Then when you master this technique you move on to the next technique which is split-half search. Remove half of the RAM and boot the computer. If it boots up, then you put all the RAM back and remove the other half. Then it should fail to boot, and you remove half of the remaining RAM and see if it boots. By moving back and forth in halves instead of 1 at a time, you double your troubleshooting speed ;)

https://www.oreilly.com/library/view/apple-training-series/0321335465/0321335465_ch03lev1sec3.html
#16
Software / Re: How to get Tiny.m by Simso...
Last post by ptek - Sep 25, 2025, 01:32 PM
Quote from: jeffburg on Sep 25, 2025, 08:20 AM@ptek I saw your Discord message that its still not compiling. So here is what I would do. Reduce the file to the absolute bare minimum needed and keep adding things until it breaks again.


#import <AppKit/AppKit.h>

@interface DemoView: NSView
{
}
- (void)drawRect:(NSRect)rect;
@end

@implementation DemoView
- (void)drawRect:(NSRect)rect;
{
    [[NSColor redColor] set];  // set the drawing color to red
    NSRectFill([self bounds]);  // fill the view with red
}
-(void)windowWillClose:(NSNotification*)notification;
{
  [NSApp terminate:self];
}
@end

void setup(void)
{
    NSWindow *myWindow;
    NSView  *myView;
    NSRect    graphicsRect;

    graphicsRect = NSMakeRect(100.0, 350.0, 400.0, 400.0);
    myWindow = [ [NSWindow alloc]
              initWithContentRect: graphicsRect
                        styleMask:NSTitledWindowMask
                                  |NSClosableWindowMask
                                  |NSMiniaturizableWindowMask
                          backing:NSBackingStoreBuffered
                            defer:NO ];
    [myWindow setTitle:@"Tiny Application Window"];

    // Change this back to DemoView
    myView = [[[DemoView alloc] initWithFrame:graphicsRect] autorelease];
    [myWindow setContentView:myView ];
    [myWindow setDelegate:myView ];
    [myWindow makeKeyAndOrderFront: nil];
}

int main(int argc, char *argv[])
{
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    NSApp = [NSApplication sharedApplication];
    setup(); // uncomment this because we now have a setup function
    [NSApp run];
    [NSApp release];
    [pool release];
    return(EXIT_SUCCESS);
}


Thanks so the code was able to compile with post #7 code block 4 which is listed above.

Adding the following code block below does not work as there is no NSBezierPath() on OS4.2 so I will try to shoehorn the Post Script draw code from the NS3.0.

- (void)drawRect:(NSRect)rect   // instance method implementation
{
    double f,g;
    double const pi = 2 * acos(0.0);
    int n = 12;

    NSPoint p1,p2; <---- declare the variables at the beginning

    float width  = [self bounds].size.width;
    float height = [self bounds].size.height;
    [[NSColor whiteColor] set];
    NSRectFill([self bounds]);
    [[NSColor blackColor] set];
    for (f=0; f<2*pi; f+=2*pi/n) {
        for (g=0; g<2*pi; g+=2*pi/n) {
            p1 = NSMakePoint(X(f),Y(f));
            p2 = NSMakePoint(X(g),Y(g)); <------ remove the NSPoint to reuse the existing variables instead of declaring new ones
            [NSBezierPath strokeLineFromPoint:p1 toPoint:p2];
        }
    }
}

Quote from: jeffburgThis is interesting. When I removed the NIB's from my App, OpenStep 4.2 was not happy about it. Particularly the Menus in OS4.2 are not retained by NSApplication, instead they are retained by their NIB which seems crazy to me but that's how it is. So the app would always crash after launching because the menus would be released from memory and then NSApplication would try to access them so it could render them.

  Your explanation about the menus is interesting because I was wondering why he didn't include it for the example for MacOSX.
#17
Hardware / Re: NeXTDimension VRAM error
Last post by ZombiePhysicist - Sep 25, 2025, 01:27 PM
I could be wrong, but didn't the ND board need a minimum of 8MB to work?
#18
Software / Re: How to get Tiny.m by Simso...
Last post by jeffburg - Sep 25, 2025, 08:26 AM
And looking at the drawing code, I think this is the problem. This I think is not allowed in C89, variable declarations in the middle of the function

    for (f=0; f<2*pi; f+=2*pi/n) {        // draw the fancy pattern
        for (g=0; g<2*pi; g+=2*pi/n) {
            NSPoint p1 = NSMakePoint(X(f),Y(f)); <---- These are new variables declared in the middle of the function
            NSPoint p2 = NSMakePoint(X(g),Y(g));
            [NSBezierPath strokeLineFromPoint:p1 toPoint:p2];
        }
    }

So you might be able to fix it by changing the drawrect code to this

- (void)drawRect:(NSRect)rect   // instance method implementation
{
    double f,g;
    double const pi = 2 * acos(0.0);
    int n = 12;

    NSPoint p1,p2; <---- declare the variables at the beginning

    float width  = [self bounds].size.width;
    float height = [self bounds].size.height;
    [[NSColor whiteColor] set];
    NSRectFill([self bounds]);
    [[NSColor blackColor] set];
    for (f=0; f<2*pi; f+=2*pi/n) {
        for (g=0; g<2*pi; g+=2*pi/n) {
            p1 = NSMakePoint(X(f),Y(f));
            p2 = NSMakePoint(X(g),Y(g)); <------ remove the NSPoint to reuse the existing variables instead of declaring new ones
            [NSBezierPath strokeLineFromPoint:p1 toPoint:p2];
        }
    }
}

But like I said, you should do the step by step in my previous post trying to modify this part.
#19
Software / Re: How to get Tiny.m by Simso...
Last post by jeffburg - Sep 25, 2025, 08:20 AM
@ptek I saw your Discord message that its still not compiling. So here is what I would do. Reduce the file to the absolute bare minimum needed and keep adding things until it breaks again.

Step 1, just the main function

#import <AppKit/AppKit.h>

int main(int argc, char *argv[])
{
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    NSApp = [NSApplication sharedApplication];
    // setup(); // comment this out because we have no setup function yet
    [NSApp run];
    [NSApp release];
    [pool release];
    return(EXIT_SUCCESS);
}


If that compiles go to step 2 where we add the setup function

#import <AppKit/AppKit.h>

void setup(void)
{
    NSWindow *myWindow;
    NSView   *myView;
    NSRect    graphicsRect;

    graphicsRect = NSMakeRect(100.0, 350.0, 400.0, 400.0);
    myWindow = [ [NSWindow alloc]
               initWithContentRect: graphicsRect
                         styleMask:NSTitledWindowMask
                                  |NSClosableWindowMask
                                  |NSMiniaturizableWindowMask
                           backing:NSBackingStoreBuffered
                             defer:NO ];
    [myWindow setTitle:@"Tiny Application Window"];

    // Change this to NSView because we have no implemented DemoView yet
    myView = [[[NSView alloc] initWithFrame:graphicsRect] autorelease];
    [myWindow setContentView:myView ];
    [myWindow setDelegate:myView ];
    [myWindow makeKeyAndOrderFront: nil];
}

int main(int argc, char *argv[])
{
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    NSApp = [NSApplication sharedApplication];
    setup(); // uncomment this because we now have a setup function
    [NSApp run];
    [NSApp release];
    [pool release];
    return(EXIT_SUCCESS);
}


If this compiles and runs you should see a blank window. And now you can go to step 3 where we will add our empty NSView subclass


#import <AppKit/AppKit.h>

@interface DemoView: NSView
{
}
- (void)drawRect:(NSRect)rect;
@end

@implementation DemoView
- (void)drawRect:(NSRect)rect;
{
}
-(void)windowWillClose:(NSNotification*)notification;
{
}
@end

void setup(void)
{
    NSWindow *myWindow;
    NSView   *myView;
    NSRect    graphicsRect;

    graphicsRect = NSMakeRect(100.0, 350.0, 400.0, 400.0);
    myWindow = [ [NSWindow alloc]
               initWithContentRect: graphicsRect
                         styleMask:NSTitledWindowMask
                                  |NSClosableWindowMask
                                  |NSMiniaturizableWindowMask
                           backing:NSBackingStoreBuffered
                             defer:NO ];
    [myWindow setTitle:@"Tiny Application Window"];

    // Change this back to DemoView
    myView = [[[DemoView alloc] initWithFrame:graphicsRect] autorelease];
    [myWindow setContentView:myView ];
    [myWindow setDelegate:myView ];
    [myWindow makeKeyAndOrderFront: nil];
}

int main(int argc, char *argv[])
{
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    NSApp = [NSApplication sharedApplication];
    setup(); // uncomment this because we now have a setup function
    [NSApp run];
    [NSApp release];
    [pool release];
    return(EXIT_SUCCESS);
}


if that compiles and runs then we can implement super minimum code in the two methods of DemoView



#import <AppKit/AppKit.h>

@interface DemoView: NSView
{
}
- (void)drawRect:(NSRect)rect;
@end

@implementation DemoView
- (void)drawRect:(NSRect)rect;
{
    [[NSColor redColor] set];   // set the drawing color to red
    NSRectFill([self bounds]);  // fill the view with red
}
-(void)windowWillClose:(NSNotification*)notification;
{
  [NSApp terminate:self];
}
@end

void setup(void)
{
    NSWindow *myWindow;
    NSView   *myView;
    NSRect    graphicsRect;

    graphicsRect = NSMakeRect(100.0, 350.0, 400.0, 400.0);
    myWindow = [ [NSWindow alloc]
               initWithContentRect: graphicsRect
                         styleMask:NSTitledWindowMask
                                  |NSClosableWindowMask
                                  |NSMiniaturizableWindowMask
                           backing:NSBackingStoreBuffered
                             defer:NO ];
    [myWindow setTitle:@"Tiny Application Window"];

    // Change this back to DemoView
    myView = [[[DemoView alloc] initWithFrame:graphicsRect] autorelease];
    [myWindow setContentView:myView ];
    [myWindow setDelegate:myView ];
    [myWindow makeKeyAndOrderFront: nil];
}

int main(int argc, char *argv[])
{
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    NSApp = [NSApplication sharedApplication];
    setup(); // uncomment this because we now have a setup function
    [NSApp run];
    [NSApp release];
    [pool release];
    return(EXIT_SUCCESS);
}


So if that compiles and runs, you should get a red window and when you close the window the application should quit. If that is working, then there is something with the gobbly-gook drawing code in drawRect: that OpenStep doesn't like. So maybe you could debug that on your own.

If it doesn't work, let me know where it breaks.
#20
Software / Re: How to get Tiny.m by Simso...
Last post by jeffburg - Sep 25, 2025, 04:49 AM
Well your @ends are definitely balanced correctly. I think the issue might be that the C compiler in OpenStep is not C99 compatible. I am not sure when C99 support was added to Project Builder but it was some time around 10.2 Jaguar. So I think the C function declaration setup() and main() need to use older C89 syntax

int main(void)
void setup(void)

also, I am not sure if it matters, the but the default main implementation in Objective C is actually

int main(int argc, char *argv[]) { /* ... */ }

https://stackoverflow.com/a/41805712