About Window Management

Window management refers to the process of gracefully handling overlapping windows. Window management is done automatically by Vermont Views. When you have several windows on the screen at once, Vermont Views will take care of any places where they overlap, as well as updating the screen after dragging or resizing a window. Vermont Views window management allows multiple windows to share the same screen without conflicts.

To perform window management Vermont Views needs two things: (1) A linked list of windows that are on the screen and (2) buffers for all window output, so that window contents can be flushed to the screen when screen regions need to be updated. The linked list shows the order of the windows, i.e., which windows are on top of which. The buffers are used to update the screen when a window is removed, resized, dragged, or brought to the top of the linked list of windows.

The linked list of windows is a singly-linked list. When you place the first window on the screen, it is at the top of the linked list of windows. It becomes the current window, and its next window pointer is a NULLP. When another window is placed on the screen, it becomes the top window and its next window pointer points to the first window that was put up.

As you put windows up and bring them down, Vermont Views automatically updates the screen and maintains the linked list of windows. When you bring a window to the top, it moves to the top of the linked list.

If you are doing non-modal programming, you can have several windows on the screen at once and allow the user to switch between them by clicking the mouse on the window he or she wishes to bring to the top. Vermont Views will automatically update the screen and the linked list of windows. Windows will also automatically come to the top when you begin a drag or resize operation.

When the user clicks the mouse to bring a window to the top, Vermont Views will determine the location of the mouse and then search the linked list of windows on the screen to see what window the mouse was clicked in. If the mouse is not in the current window, it will determine which window the mouse is in and which part(s) of that window are covered by other windows. Vermont Views uses that window's buffer to update the area(s) of the window that are covered, so that the entire window is visible. The linked list of windows is then updated by removing the window from its current link and placing it at the top of the linked list as the current window.


Home Contents Previous Next