VisComp: 3.2 Using VisCompClass: Managing Graphic Windows

Up: GEOS SDK TechDocs | Up | Prev: 3.1 Managing Geometry

It is very rare that a visible object will want to create its own window without using a generic object. This practice is highly discouraged as well because it will almost certainly violate some principles of most specific UI specifications. You can, however, set up a visible object to have its own window with the following steps:

  1. Set up the VisComp object as a window group.
    Either instantiate a new VisComp object or set it up and load it in, off-screen. Then set the flags VTF_IS_WINDOW and VTF_IS_WIN_GROUP in the composite to make it a window and the top of the visible tree.
  2. Add visible children to the window object.
    Using MSG_VIS_ADD_CHILD , add any visible object children to the window group as you need. If some of the children had possibly been removed from the visible tree earlier, you may have to mark them invalid.
  3. Add your window to the field window.
    Determine the handle of the parent window you need, then set your window group object as a child of the parent.
  4. Set the top object in your window group visible.
    Set VA_VISIBLE using MSG_VIS_SET_ATTR to mark the window group visible. The window will be opened, and it will receive a MSG_META_EXPOSED indicating that it and all its children should draw themselves.

Up: GEOS SDK TechDocs | Up | Prev: 3.1 Managing Geometry