This chapter is very lean... to be filled in at a later date...
List of direct manipulation tools:
The mode affect how the user's mouse actions are interpreted by viola.
When in "action" mode, user's mouse action get translated to events that are sent to the object. This is the default mode when the program start up.
When in "move" mode, clicking on an object does not produce the usual "buttonPress" and "buttonRelease" messages, but allows the user to drag and change the position of an object. When in "resize" mode, it lets one affect the width and height of an object's window.
When in the "target" mode, clicking on an object does not cause
any messages to be sent to the object (as would in "action" mode").
Instead, the name of the object being clicked on is stored in
a system variable and retrivable by the
However, object that are locked -- that is, the objects with the "lock" attribute being non-zero -- can not be selected themselves. This is so that the application builder can work normally (in action mode). But, don't worry about this unless you're thinking about writing an interface/application builder application (hint hint hint).
How to switch modes.
THe shell application is a way to issue commands to the viola
interpreter. To invoke it in a script, execute this statement:
This is what the shell looks like.
A statement that you enter into the shell is interpreted in the context of the target object (the object context is displayed in the "Object:" field). This means that the statement is executed as if that context object executed it.
For example, the statement ``get("name");'' yields different values depending on the context.
To change the context, you could use the select tool to pick
another object, or use the
This shell hopefully will eventually develop into a full interface builder and object browser. Right now it's quite rudimentary, but it's useful for peeking and poking at objects for prototyping and diagnostic purposes.