          Using the examples
          ------------------

The programs
------------

This directory contains the following Tcl scripts for use with ttwish. To run
them, type 'ttwish -file slide.tcl' for examples.

slide.tcl
      Launch several occurences of this program and move the slider : you will
      see each slider update its position to reflect the changes. Each time
      the slider is changed, the involved application broadcasts a message
      asking any other occurences to update their position.

tclttmon.tcl
      A full Tooltalk monitor that will let you send messages and register
      patterns to understand better how Tooltalk works. The main
      window will present you five buttons and a text area. This letter
      will display all the incoming messages matching the pattern you
      specified.

      The buttons :

      . Start/Stop : enable/disable the debugger. When the debugger is
      turned off (the button displays "Start"), tclttmon won't
      intercept any messages. Push this button to register the latest
      pattern again.

      . Pattern... : pressing this button will pop up a window showing
      a synthetic view of a pattern. On the left of this window,
      toggle buttons let you pick what fields of the pattern you wish
      to be active. Specify the value of these fields by selecting the
      proper value in front of the toggle button. Once you are
      satisfied, click on 'Register'. The previous pattern will be
      destroyed and the one you just defined is now registered.

      . Message... : pressing this button will pop up a window showing
      a synthetic view of a message. On the left of this window,
      toggle buttons let you know what fields of the message you wish
      to be active. Specify the value of these fields by selecting the
      proper value in front of the toggle button. Once you are
      satisfied, click on 'Send'. The monitor will send the message
      and, in case the latest registered pattern matches this message,
      will display the message in the main window

      . Display... : use the window popped up by this button to select
      the message fields you are interested in. Each time a message is
      received by the monitor, it will display all the fields you
      selected in this window, thus allowing you to focus on the
      information of interest.


Example session
---------------

. Launch several "slide" and see how they update to reflect the
position of the last-changed slide

. Launch the monitor, and move a slide again. This time, the monitor
will receive the messages exchanged by the slides (on startup, the
monitor registers a general pattern that matches the messages used by
the slides). Even if you drag the slides, the monitor keeps up with
the messages. As you can see, the "Args" field of the message is used
to convey the new position

. In the monitor, press the 'Message' button. Remove the arguments
"One", "Two" and "Three" by double-clicking on them and pressing
"Remove". Type the value 15 in the string gadget on the left of
the buttons Add/Remove and press Return. Now our next message will
contain one argument that is "15". Now "Send" this message. Notice
how all the slides change their position to 15. We "forged" a message.
This is very useful when you are developing an application and you
wish to make sure it is responding correctly to messages.



