[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to do graphics



> 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
  methods.

  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!

Bay