STklos version 4.0

 

What is STklos

STklos is an extension of STk which provides à la CLOS objets to STk. This implementation is based on the
implementation of version 1.3 of the Tiny CLOS  package defined by Gregor Kickzales (available by ftp at parcftp.xerox.com:/pub/mop/*).

Compiling STklos

STklos is compiled during the interpreter construction. You don't have to do something in this directory.

Simple Test of STklos

STklos needs some files to run properly. Until you have installed it in its definitive place, you have to:
  1.   set your default directory to STklos
  2.   use the the shell script ../Src/test-stk to run the interpreter
So, you just have to type To test, that everything is OK, you can try: which should yield 30 if everything is correct.

Using STklos with the Tk toolkit

A set of classes have been defined to use Tk with object flavor. All the Tk widgets have been  wrapped in STklos. classes.The following example creates a three buttons panel (button 1 & 2 being on top of button 3). Note usage of Scheme names in the two preceding pack calls instead of dotted Tcl/Tk names.

Tk options can be seen as slot in the STklos world. So getting the font of  button 3 can be done with

and changing its value can be done with and associating a callback to button 1 can be done with the following expression The desribe function permits to see all the slots value of a given object. For instance, would give something like: Destruction of a button can be obtained with the destroy-widget generic function as in

Examples

Some examples (too few) are available in the Examples directory. What those examples do is not interesting per se but rather how they are written.
Note:There are not enough examples. Send me programs if you have interestingpieces of code to make this directory growing.Thanks
 

Have fun.