This is NOT the way to encapsulate X Widgets and Motif.  It is much
like the application framework that Young demonstrated for C++.


Quite frankly, encapsulating one object paradigm within another just
brings about kludges and ugly hacks to get things to work.


I wrote all of this in a day or so by cut-n-paste from young's work so
it isn't pretty.  I did this to understand the problems with
integrating X into Objective-C (and to see if they were about the same
as integrating with C++).

There are no docs.  Some of the classes do not work (like MacMainWindow,
Browser,ListView) since I did not continue the investigation.  The ``init''
methods are not well defined and change depending on what object it is
so do not expect consistency.

It's just nasty meshing.  Here is an example of building a menu:


  mb = [[MenuBar alloc] init:"blah" mainWindow:mw ];
  sm = [[mb addSubMenuItem:mb xname:"blah"] label:"Doc" mnemonic:'D'];
  [[mb addMenuItem:sm xname:"open"] label: "Open" mnemonic:'O'];
  [[mb addMenuItem:sm xname:"new"] label: "New"];	
  [[mb addMenuItem:sm xname:"new"] label: "Save"];
  [[mb addMenuItem:sm xname:"new"] label: "Save As"];
  [[mb addMenuItem:sm xname:"new"] label: "Save To"];
  [[mb addMenuItem:sm xname:"close"] label: "Close"];
  sm2 = [[mb addSubMenuItem:sm xname:"blah2"] label:"Windows" mnemonic:'W'];
  [[mb addMenuItem:sm2 xname:"tile"] label:"Tile"];
  sm3 = [[mb addSubMenuItem:mb xname:"exit"] label:"Exit"];
  [[mb addMenuItem:sm3 xname:"exit"] label:"Exit" mnemonic:'E'
    accelerator:"Ctrl<Key>E" acceleratorText:"Ctrl-E"];
  [[mb addMenuItem:sm3 xname:"quit"] label:"Quit" mnemonic:'Q'
   accelerator:"Ctrl<Key>Q" acceleratorText:"Ctrl-Q"];
  [mw menuBar:mb];

  [mw makeKeyAndOrderFront: self];
  a = [[BlahWindow new:"blah1MainWindow"] init]; <- This is a window
  [a makeKeyAndOrderFront: self];



The good things:

1) it compiles
2) there is an example program (look for prefixes of blah in the filenames).
	executable is called blah.

Note that it was originally compiled under a 2.2(?) or 2.3(?) or so with the objc
parts from the beta release of the runtime.  It did compile under 2.4.3 with
the included runtime.




Gregory B. Lampshire
gbol@rglnext.geol.vt.edu
gbol@shell.com
