A SERVICE OF

logo

137
Chapter 12
12. User Interface Mechanisms
Cosmo 3D applications either appear within a csWindow object or a window object that
you create using X window code. The window provides an interface for users to interact
with the Cosmo 3D application.
Cosmo 3D also supports user interaction by enabling the selection of screen objects.
This chapter discusses how to implement user interaction using X window code,
csWindow, and selection mechanisms.
These are the sections in this chapter:
•“Creating a csWindow on page 137.
•“Handling User Input on page 139.
•“Selecting Screen Objects on page 140
•“Creating Your Own Window on page 143.
Creating a csWindow
All of the csWindow elds have default values. You may nd that they satisfy the needs
of your application. worm.cxx, for example, uses all the default values.
If you want to change the initial position, size, and mode of the csWindow object, you
use the following methods:
static void initDisplayMode(unsigned long mode);
static void initPosition(int x, int y);
static void initSize(int width, int height);