Skip to Main Content
Volume 7A: XView Programming Manual
book

Volume 7A: XView Programming Manual

by Dan Heller
October 1994
Intermediate to advanced content levelIntermediate to advanced
770 pages
22h 58m
English
O'Reilly Media, Inc.
Content preview from Volume 7A: XView Programming Manual
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
Each cell is considered a unit to the scrollbars, so the number of pixels per scrollbar-unit
must be set to the size of the cell. Thus, the attribute SCROLLBAR_PIXELS_PER_UNIT is set
to 64 for each scrollbar (the width and height are the same). With this attribute set, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Volume 6A: Motif Programming Manual

Volume 6A: Motif Programming Manual

David Brennan, Dan Heller, Paula Ferguson
Java™ Media APIs: Cross-Platform Imaging, Media, and Visualization

Java™ Media APIs: Cross-Platform Imaging, Media, and Visualization

Alejandro Terrazas, John Ostuni, Michael Barlow

Publisher Resources

ISBN: 9780937175873