ClassPackage: cgToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.1
Unrevised from 10.0 to 10.1.
10.0 version


The class of transparent-panes.

Instances of this class are windows that allow other windows to show through them from behind. A transparent-pane may be useful for intercepting mouse clicks from, or arbitrarily drawing over, a set of sibling windows that lie behind it.

A transparent-pane differs from a regular window in two ways:

(1) Its :transparent-p initarg (to make-window) when created defaults to non-nil, which tells windows that are behind it that they still need to draw themselves since the window covering them is transparent.

(2) Its redisplay-window method overrides the default method that normally "clears" a window's background by filling the background area with the window's background-color. (Either or both of these effects could be achieved with a window of any class by passing :transparent-p t to make-window and/or overriding the default redisplay-window method; the transparent-pane class merely encapsulates these two options into a subclass.)

Note that a transparent-pane does not behave totally as a truly transparent object would intuitively behave, and therefore has limited application. In particular, if a transparent-pane is moved or another window is brought in front of it, windows that overlap the transparent-pane will not know that they may need to redisplay themselves, and so unexpected leftover images may remain in the area of the transparent-pane. Therefore a transparent-pane is probably useful only as a child of a parent window that knows when it needs to redisplay itself or its other children after manipulating the transparent-pane child.

The frame-child of a form window in the IDE is a transparent-pane that is kept in front of all of the controls on the form. This illustrates the two likely uses of a transparent-pane. First, whenever the user clicks in the interior of a form, regardless of whether the click is over the border or interior of a control or in the empty area of the form, the click goes to the transparent-pane because it is in front; this allows any click in the form's interior to be handled in a standard way by a single method on the transparent-pane, overriding the usual click behavior of the individual controls. Second, drawing can be performed on the transparent-pane that may arbitrarily overlap the controls; this makes it easy for the IDE to draw resizing handles that overlap both the borders and the interiors of controls (when multiple controls are selected). Applications may find similar uses for transparent-panes if they are used with care.

GTK Note

You cannot draw on a transparent-pane on GTK, and a transparent-pane cannot have child windows.

A diagram of window and widget classes is shown in Widget and window classes in cgide.htm.

Copyright (c) 1998-2022, Franz Inc. Lafayette, CA., USA. All rights reserved.
This page was not revised from the 10.0 page.
Created 2019.8.20.

Allegro CL version 10.1
Unrevised from 10.0 to 10.1.
10.0 version