graphical things

Bay-Wei Chang Bay.Chang at Eng.Sun.COM
Thu Apr 7 22:01:43 UTC 1994


> Is there a simple way to open a window and plot characters or pixels
> on it?
> Also - how about user input?

The current release has support for Xlib calls, but it does not have
higher level graphical or input support.  See the objects "window",
"bitmap", and "xlib".

Here's an example of how to open a simple window and draw to it.

  myWin: window copy open.
  myWin bitmap rectangle: (10 at 10) # (60 at 60) Color: ( | index = 1 | ).
  myWin flush.

The argument for Color: is usually a "colormapEntry" object, but the
only slot used in these drawing calls is the index slot, so you can
just substitute any kind of object that returns an index.  The index
is the colormap index of the installed colormap, so whatever is stored
at that location will determine the color displayed.  If you want to
specify your own colors, see "colormap" and "xlib".

As for user input: the "window" object uses "simpleEventHandler" by
default.  Copy and modify that event handler to do what you want.

Bay



More information about the Self-interest mailing list