Monday, November 28, 2005

lab 47 - self tk


lab 47 - self tk


I was inspired by watching a video about Sun's Self system, which also inspired Squeak's morphic user interface. The scripts in this lab were an attempt to get tk windows serving a file that described themselves, so that the file could be copied to disk, and later run to recreate the window.


Here's an example.

% ./text
% cp /chan/tk.239 t1
% run t1

You should now have two text windows open. Edit either one of them, then copy and run them again. Both the contents and the position of each window should be saved and restored. Right-clicking in the window brings up the titlebar, whichs pops up underneath the window because it is the last thing packed into the tk widget. Right-clicking again makes it disappear. One of the ideas being explored is that a set of widgets can be configured and placed on the screen then all the /chan/tk.* files copied to a directory that acts as a stored workspace, to be later restored with all the widgets in the exact same configuration.

I've included attempts at a few others, such as scale, button, and canvas. Most of the functionality is in the tklib sh file.

This is a first cut. To show the 'self' idea translated in a way appropriate (maybe) to the file/shell/software tools experience. A different notation for the files might be more appropriate.


No comments: