Overview of ASBrowser ASEventBrowser and ASListener

The ASBrowser, ASEventBrowser, and ASListener examples show how simple it is to use the space browser and listener features to iterate over the contents of a space, or to listen for events on a space. ASBrowser and ASListener do exactly the same thing, but each uses a different set of ActiveSpaces API calls to achieve its goal. ASEventBrowser implements an event listener. Examine all three programs to evaluate when to use a browser and when to use a listener in your own code.

These examples are also very useful when designing and debugging your own applications. Since they do not care about the definition of the space being browsed or listened to, they can be used, for example, to get a dump of the data contained in a space, or to monitor the actions taken on a space by another application.

Note: For example, try to launch ASOperations and, at the same time, use ASListener on the space called myspace to see the effects of the various space operations.

Do not forget to experiment with the timescope attribute as well.