Drawing on the slate -- an introduction to the VL Toolkit

The slate is an itcl widget that implements an object-oriented drawing surface. It is built on top of the Tk canvas, but provides many higher-level operations:

Firstly, we need to create a slate. For the purposes of this demo, we'll just pack the slate into the "." top-level window. The slate is just a widget that can be packed anywhere -- packing into a proper Tycho top-level window and setting up menus and so on is your job!

So, let's start with a blank slate:

::tycho::slate .s -background grey85  ;# create the slate
set slate .s                          ;# give it a variable name
pack .s -expand on -fill both         ;# pack it
wm deiconify .                        ;# display the top-level window

The rest of this tutorial is divided into a bunch of parts. They don't have to be done in any particular order, although it might be better to. Familiarity with the Tk canvas is not required, but will certainly help -- see the canvas man page for more information on the canvas.


Last updated: 96/11/06, comments to: tycho@eecs.berkeley.edu