Menu

#1 PPxWindow close bug

open
nobody
None
5
2006-01-31
2006-01-31
ratchet
No

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() );
}

Discussion


Log in to post a comment.

MongoDB Logo MongoDB