The "Close" method in this class doesn't work. I fixed it by adding the
WindowRef parameter to the CarbonEvent used in the implementation.
i.e. change existing code:
void
Window::Close()
{
SysCarbonEvent closeEvent(kEventClassWindow,
kEventWindowClose);
closeEvent.PostTo(GetSysEventTarget());
}
to:
void
Window::Close()
{
SysCarbonEvent closeEvent( kEventClassWindow,
kEventWindowClose );
WindowRef window = GetSysWindow();
closeEvent.SetParameter(
kEventParamDirectObject,
typeWindowRef,
sizeof( WindowRef ),
&window
);
closeEvent.PostTo( GetSysEventTarget() );
}