ftp.nice.ch/Attic/openStep/implementation/gnustep/sources/objcX-0.87.tgz#/objcX-0.87/examples/FileViewer/FileViewer.m

This is FileViewer.m in view mode; [Download] [Up]

/* Demostration application using objcX: a fileviewer
 *
 * Author: Libing Wang
 */

#include "appkit/Application.h"
#include "appkit/Window.h"
// #include "appkit/Matrix.h"
// #include "appkit/ScrollView.h"
#include "appkit/NXBrowser.h"
#include "BrowserDelegate.h"


int main(int argc, char **argv)
{
    id                  myBrowser;
    Window             *myWindow;
    NXRect              myFrame;

    [[Application alloc] initargc:argc argv:argv];
    
    myFrame.size.width  = 500;
    myFrame.size.height = 250;
    myFrame.origin.x = 0;
    myFrame.origin.y = 0;
    myWindow = [[Window alloc] initContent:&myFrame];
    [myWindow setTitle:"ObjcX File Viewer"];
    
    myFrame.size.width  = 480;
    myFrame.size.height = 230;
    myFrame.origin.x = 10;
    myFrame.origin.y = 10;
    myBrowser = [[NXBrowser alloc] initFrame:&myFrame];
    [myBrowser setMinColumnWidth:160];
    [myBrowser setMaxVisibleColumns:3];
    
    [myBrowser setDelegate:[[BrowserDelegate alloc] init]];
    [myBrowser setTarget:[myBrowser delegate]];
    [myBrowser setDoubleAction:@selector(execute:)];

    [[myWindow contentView] addSubview:myBrowser];
    [myBrowser loadColumnZero];
    [myWindow orderFront:nil];
    
    [NXApp run];
    [NXApp free];
    return 0;
}

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.