displaying a grid of images
Robert Withers
reefedjib at yahoo.com
Tue Jan 2 23:04:32 UTC 2007
Can anyone demonstrate how I could display a grid of images within a
SystemWindow? For example, I have a 5 by 5 grid and each grid would
display a scaled Form. I tried adding a morph for each cell and I
ran into a couple of problems. First, as I increase the size of the
grid, window creation takes longer and longer due to the processing
of Splitters, it looks like. I don't need those I don't believe.
Secondly, given this drawOn: method:
drawOn: aCanvas
| src dest |
src := self form.
dest := Form extent: self extent depth: aCanvas form depth.
src displayScaledOn: dest.
aCanvas drawImage: dest at: bounds origin.
For each use in the grid of a particular form (I am reusing the
source forms of which there are 7 currently) it would get
progressively magnified. It is like the #displayScaledOn: is
affecting the src form.
I think I need to blt each grid form into a window sized form and
build my own grid image then draw it to the canvas. Does that sound
like the right approach? Does anyone have some example code of this
kind of thing? I will also be needing to identify where mouse
clicks are happening within this image and take some action.
thanks fr any help,
Robert
More information about the Squeak-dev
mailing list
|