When writing a report, you might end up wanting to embed a screenshot of a particular part of the screen.
For example, recently there was a request on the Moose mailing list for taking a screenshot from only a part of a Glamour browser. One solution would be to have the possibility to script the browser to know how to take a screenshot of the desired part. However, this is not possible with the Glamour current model. We need a different angle to approach this problem pragmatically.
The browser is rendered using morphs. And morphs are objects that are nested, like in any other user interface framework, and that have a model. We could try to query the morphs based on the attached model to identify the desired sub part to take a screenshot of. The problem is that the morphs are not quite uniform, and it is hard to query them because of that. With this occasion, I also saw that Glamour does not have a consistent way of mapping to morphs either which makes things even more complicated for querying.
However, for the problem of generating a one-time screenshot, we do not need a fully automatic solution. A different approach would be to build a tool that makes it reasonably cheap to take a highly customized screenshot.
And it so happens that the tool already exists: the GTInspector. Here is the recipe:
The video below shows how it looks.
Automation is perfect when it fits. But, when it does not fit, you can greatly benefit from custom interactive tools that exploit your visual capabilities to discern relevant information. Such tools should be integral part of any software engineering toolkits.