This is testApp.m in view mode; [Download] [Up]
/* testApp.m Simple test application Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley <scottc@net-community.com> Date: March 1996 This file is part of the GNUstep GUI X/DPS Backend. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. If you are interested in a warranty or support for this source code, contact Scott Christley <scottc@net-community.com> for more information. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <AppKit/AppKit.h> #include <gnustep/xdps/PXKWindow.h> #include "TestView.h" int main(int argc, char **argv) { NSWindow *win; NSApplication *theApp; TestView *new_view; NSRect bf = {{100, 100}, {100, 100}}; NSButton *b0; NSRect mf0 = {{25, 50}, {200, 500}}; NSMatrix *mt0; initialize_gnustep_backend(); theApp = [NSApplication sharedApplication]; NSLog(@"Create a window\n"); win = [[NSWindow alloc] init]; NSLog(@"Window number %d\n", [win windowNumber]); NSLog(@"XWindow number %d\n", [(PXKWindow *)win xWindow]); // new_view = [[TestView alloc] init]; // [win setContentView: new_view]; // b0 = [[NSButton alloc] initWithFrame: bf]; // [[win contentView] addSubview: b0]; // [b0 setTitle: @"Hello"]; mt0 = [[NSMatrix alloc] initWithFrame: mf0 mode: NSHighlightModeMatrix cellClass: [NSButtonCell class] numberOfRows: 10 numberOfColumns: 3]; //mt0 = [[NSMatrix alloc] init]; [[win contentView] addSubview: mt0]; [win display]; [win setTitle:@"GNUstep GUI X/DPS Test Application"]; NSLog(@"Run application\n"); [theApp run]; return 0; }
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.