How to do graphics

Bay-Wei Chang Bay.Chang at Eng.Sun.COM
Thu Sep 22 03:16:54 UTC 1994

> To look at this code, type "windoid" in an evaluator.
> Sprout the parent slot to see the methods in the traits object.

John's suggestion is excellent.  A couple of extra hints to help you on
your way:

  windoid is a kind of window.

  Just typing "window copy" will create a generic window on the screen
  (it doesn't do anything).

  To draw into the window, which you will probably want to do, you
  will want to draw into its bitmap.  See traits drawing for drawing

  To handle events in the window, replace the simpleEventHandler
  (which ignores all events except quit) with something similar that
  does useful things.  See "traits xlib events" for the kinds of
  events and what methods to send to get info like x & y position.

	                   traits drawing
		           traits bitmap
			   traits windowBitmap
             window              ^
	    ---------   	 |
           | bitmap  | ->  windowBitmap
	   |    .    |
	   |    .    |
	   | handler | ->  simpleEventHandler
	   |    .    |

Good luck!


More information about the Self-interest mailing list