This file contains general information for Mandelbrot, the Xlib demo
for Sather.  If you have questions concerning this file, to
Mandelbrot, or to the Xlib interface for Sather, mail to
<schnetter@student.uni-tuebingen.de>.  This text was last updated on
1994/12/09



The Sather Xlib routines are supposed to provide an interface between
Sather and the X window system.  They are not optimized for speed, as
X is notoriously slow (and usually runs over a network connection).
It is, however, designed to provide an object-oriented interface.
Here an example in Sather:

class MAIN is
   main is
      [...]
      display ::= #X_DISPLAY;
      display.Open;
      [...]
      window ::= #X_WINDOW;
      window.Create (display, parent, position, size, 2, white, black);
      window.StoreName ("Test - Test - Test");
      window.SelectInput ( |Exposure, KeyPress| );
      window.Map;
      [...]
      event_handler.NextEvent (display);
      [...]
      window.Unmap;
      window.Destroy;
      display.Close;
      [...]
   end; -- main
end; -- class MAIN

class MY_EVENT_HANDLER < $X_EVENT_HANDLER is
   ExposeEvent (event: X_EXPOSE_EVENT) is
      pixmap.CopyArea (window, gc, event.r, event.r.p);
   end; -- ExposeEvent

   KeyPressEvent (event: X_KEY_EVENT) is
      [...]
   end; -- KeyPressEvent
end; -- class MY_EVENT_HANDLER



Coming with this preliminary version of the library is the demo
'mandelbrot'.  It uses some of the basic X (and none of the Xt)
functions.  The functions used by this program are so far the only
ones implemented.

How to compile Mandelbrot:

	cs mandelbrot.sa -o mandelbrot -main MANDELBROT -debug



By the way: The Iters in Sather allow for an almost natural way of
doing two things at once: computing the mandelbrot set and answering
to the events sent by X.  Well, it would be even more elegant in
pSather.



How to use Mandelbrot:

'mandelbrot' accepts the following options:

-size <width> <height>:
<width> and <height> specify the size of the window that is created.
Both must be integer and greater than zero.  Currently 'mandelbrot'
does not respond to resizing the window.

-frame <re-min> <im-min> <re-max> <im-max>:
These four real parameters specify the part of the complex plane that
is displayed.

The program calculates the mandelbrot set and displays it in a window.
Exposure events are handled.  KeyPress Events (pressing a key while
the mouse pointer is in the window) quit the program.



Of course, this program could use some major enhancements; especially
the user interface.  But as it is only a demo...



-erik
