
10.3 An Example
Let’s suppose that you want to display a list of icons that have dimensions of 64x64. You
wish to display the icons in rows and columns in a canvas. Because there may be more icons
than the canvas can display at once, you attach scrollbars to the canvas. When the user uses
the scrollbars to view the icons, each scrolling action should scroll an entire icon or set of
icons into view. Paging should scroll the next page of icons into view.
For demonstration purposes, rather than display actual icons, we present a grid where each
cell in the grid represents an icon (see Figure 10-5).
1.1
2.1
3.1
4.1
5.1
6.1
7.1
1.2
2.2
3.2
4.2
5.2
6.2
7.2
1.3
2.3
3.3
4.3
5.3
6.3
7.3
1.4
2.4
3.4
4.4
5.4
6.4
7.4
8.4
1.5
2.5
3.5
4.5
5.5
6.5
7.5
8.5
1.6
2.6
3.6
4.6
5.6
6.6
7.6
8.6
1.7
2.7
3.7
4.7
5.7
6.7
7.7
8.7
3.2
4.2
5.2
6.2
7.2
3.3
4.3
5.3
6.3
7.3
3.4
4.4
5.4
6.4
7.4
3.5
4.5
5.5
6.5
7.5
3.6
4.6
5.6
6.6
7.6
3.2
4.2
5.2
6.2
7.2
3.3
4.3
5.3
6.3
7.3
3.4
4.4
5.4
6.4
7.4
3.5
4.5
5.5
6.5
7.5
3.6
4.6
5.6
6.6
7.6
backing
bitmap
canvas
subwindow
base frame with
canvas subwindow
Figure 10-5. Model for scroll_cells.c
258 XView Programming Manual