home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cl-lib07.zip / samples.zip / usr / samples / address / addresses.m < prev    next >
Text File  |  1995-03-05  |  1KB  |  43 lines

  1. #include <pm/pm.h>
  2.  
  3. #include "Controller.h"
  4. #include "address.h"
  5.  
  6. main()
  7. {
  8.   StdApp *addresses = [[StdApp alloc] init];
  9.   MainWindow *mainWindow = [[MainWindow alloc] initWithId: IDD_MAIN
  10.              andFlags: (FCF_MENU | FCF_ACCELTABLE |
  11.                     FCF_SIZEBORDER)];
  12.   Controller *controller = [[Controller alloc] init];
  13.  
  14.   [mainWindow setTitle: "Addresses"];
  15.  
  16.   [mainWindow setDelegate: controller];
  17.   [mainWindow bindCommand: IDM_EXIT withObject: controller 
  18.                  selector: @selector(closeApp:)];
  19.   [mainWindow bindCommand: IDM_NEWAD withObject: controller 
  20.                  selector: @selector(insert:)];
  21.   [mainWindow bindCommand: IDM_EDITAD withObject: controller 
  22.                  selector: @selector(replace:)];
  23.   [mainWindow bindCommand: IDM_INFOAD withObject: controller 
  24.                  selector: @selector(info:)];
  25.   [mainWindow bindCommand: IDM_DELETEAD withObject: controller 
  26.                  selector: @selector(delete:)];
  27.  
  28.   [mainWindow createObjects];
  29.  
  30.   [mainWindow insertChild: [[ListBox alloc] initWithId: IDD_PUSHBUTTON1
  31.               andFlags: WS_VISIBLE | WS_TABSTOP
  32.               in: mainWindow]];
  33.  
  34.   [controller readList: mainWindow];
  35.  
  36.   [mainWindow makeKeyAndOrderFront: nil];
  37.  
  38.   [addresses run];
  39.  
  40.   [mainWindow free];
  41.   [addresses free];
  42. }
  43.