On May 29, 2006, at 3:28 AM, Mark Gilbert wrote:
Folks.
I wonder if anyone knows how I should go about attaching an overlay
window to the top of a utility window.
I have got everything working, but a side effect of creating a new
window group to connect the windows is that the Utility window
ceases to 'float' on top of all other application windows.
- Is it possible to have this situation - where a utility window is
in a windowgroup with an overlay and still stays in front (just
with the overlay on top)
Yes, it should be possible. I'd suggest code something like this:
// create your group
WindowGroupRef group;
CreateWindowGroup( kWindowGroupAttrMoveTogether |
kWindowGroupAttrSharedActivation | kWindowGroupAttrHideOnCollapse,
&group );
// make the group be a subgroup of the utility window group
SetWindowGroupParent( group, GetWindowGroup( utilityWindow ) );
// put the utility window and the overlay window into the group
SetWindowGroup( utilityWindow, group );
SetWindowGroup( overlayWindow, group );
// make sure the overlay window is in front of the group
BringToFront( overlayWindow );
// make the overlay and utility windows always z-order together
ChangeWindowGroupAttributes( group, kWindowGroupAttrLayerTogether, 0 );
-eric