Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: When the OS moves my window, what event should I get?



Yeah, I would have thought so. As a matter of fact, I did a EventDebug=1 of my app both when it is not moved by the OS (by placing it in a normal position) and when it is moved by the OS (by placing it below the menu) and the most significant difference is this kEventWindowTransitionStarted.

However, if I try to respond to the kEventWindowBoundsChanged event, my handler doesn't run... what could be happening? Or is there a special way to respond to the kEventWindowTransition[Started|Ended] family of events?

Here's the event trace I was talking about:

Leaving target 0x34A860 with result -9874
Sending Event to 0x34A860: kEventWindowTransitionStarted, 0x34A890 "text.tcl"
Leaving target 0x34A860 with result -9874
SendEventToEventTarget entered
Sending Event to 0x321930: etrg 1
Leaving target 0x321930 with result -9874
Sending Event to 0x321930: kEventWindowTransitionStarted, 0x34A890 "text.tcl"
Leaving target 0x321930 with result -9874
SendEventToEventTarget entered
Sending Event to 0x349D80: kEventControlGetFrameMetrics
Called handler 0x93144FC4. Event was handled
Leaving target 0x349D80 with result 0
SendEventToEventTarget entered
SendEventToEventTarget entered
Sending Event to 0x34A860: etrg 1
Leaving target 0x34A860 with result -9874
Sending Event to 0x34A860: kEventWindowBoundsChanging, 0x34A890 "text.tcl"
Leaving target 0x34A860 with result -9874
SendEventToEventTarget entered
Sending Event to 0x321930: etrg 1
Leaving target 0x321930 with result -9874
Sending Event to 0x321930: kEventWindowBoundsChanging, 0x34A890 "text.tcl"
Leaving target 0x321930 with result -9874
SendEventToEventTarget entered
Sending Event to 0x34A860: kEventWindowShouldRecalcRegions, 0x34A890 "text.tcl"
Called handler 0x93154E24. Event was handled
Leaving target 0x34A860 with result 0
SendEventToEventTarget entered
Sending Event to 0x349D80: kEventControlGetFrameMetrics
Called handler 0x93144FC4. Event was handled
Leaving target 0x349D80 with result 0
SendEventToEventTarget entered
SendEventToEventTarget entered
Sending Event to 0x34A860: etrg 1
Leaving target 0x34A860 with result -9874
Sending Event to 0x34A860: kEventWindowBoundsChanging, 0x34A890 "text.tcl"
Leaving target 0x34A860 with result -9874
SendEventToEventTarget entered
Sending Event to 0x321930: etrg 1
Leaving target 0x321930 with result -9874
Sending Event to 0x321930: kEventWindowBoundsChanging, 0x34A890 "text.tcl"
Leaving target 0x321930 with result -9874
SendEventToEventTarget entered
Sending Event to 0x34A860: kEventWindowShouldRecalcRegions, 0x34A890 "text.tcl"
Called handler 0x93154E24. Event was handled
Leaving target 0x34A860 with result 0
SendEventToEventTarget entered
SendEventToEventTarget entered
Sending Event to 0x34A860: etrg 1
Leaving target 0x34A860 with result -9874
Sending Event to 0x34A860: kEventWindowBoundsChanged, 0x34A890 "text.tcl"
Called handler 0x93154E24. Event was NOT handled
Leaving target 0x34A860 with result -9874
SendEventToEventTarget entered
Sending Event to 0x321930: etrg 1
Leaving target 0x321930 with result -9874
Sending Event to 0x321930: kEventWindowBoundsChanged, 0x34A890 "text.tcl"
Leaving target 0x321930 with result -9874
SendEventToEventTarget entered
Sending Event to 0x349D80: kEventControlGetFrameMetrics
Called handler 0x93144FC4. Event was handled
Leaving target 0x349D80 with result 0
SendEventToEventTarget entered
SendEventToEventTarget entered
Sending Event to 0x34A860: etrg 1
Leaving target 0x34A860 with result -9874
Sending Event to 0x34A860: kEventWindowBoundsChanging, 0x34A890 "text.tcl"
Leaving target 0x34A860 with result -9874
SendEventToEventTarget entered
Sending Event to 0x321930: etrg 1
Leaving target 0x321930 with result -9874
Sending Event to 0x321930: kEventWindowBoundsChanging, 0x34A890 "text.tcl"
Leaving target 0x321930 with result -9874
SendEventToEventTarget entered
Sending Event to 0x34A860: kEventWindowShouldRecalcRegions, 0x34A890 "text.tcl"
Called handler 0x93154E24. Event was handled
Leaving target 0x34A860 with result 0
SendEventToEventTarget entered
SendEventToEventTarget entered
Sending Event to 0x34A860: etrg 1
Leaving target 0x34A860 with result -9874
Sending Event to 0x34A860: kEventWindowBoundsChanged, 0x34A890 "text.tcl"
Called handler 0x93154E24. Event was NOT handled
Leaving target 0x34A860 with result -9874
SendEventToEventTarget entered
Sending Event to 0x321930: etrg 1
Leaving target 0x321930 with result -9874
Sending Event to 0x321930: kEventWindowBoundsChanged, 0x34A890 "text.tcl"
Leaving target 0x321930 with result -9874
SendEventToEventTarget entered
Sending Event to 0x349D80: kEventControlGetFrameMetrics
Called handler 0x93144FC4. Event was handled
Leaving target 0x349D80 with result 0
SendEventToEventTarget entered
SendEventToEventTarget entered
Sending Event to 0x34A860: etrg 1
Leaving target 0x34A860 with result -9874
Sending Event to 0x34A860: kEventWindowBoundsChanging, 0x34A890 "text.tcl"
Leaving target 0x34A860 with result -9874
SendEventToEventTarget entered
Sending Event to 0x321930: etrg 1
Leaving target 0x321930 with result -9874
Sending Event to 0x321930: kEventWindowBoundsChanging, 0x34A890 "text.tcl"
Leaving target 0x321930 with result -9874
SendEventToEventTarget entered
Sending Event to 0x34A860: kEventWindowShouldRecalcRegions, 0x34A890 "text.tcl"
Called handler 0x93154E24. Event was handled
Leaving target 0x34A860 with result 0
SendEventToEventTarget entered
SendEventToEventTarget entered
Sending Event to 0x34A860: etrg 1
Leaving target 0x34A860 with result -9874
Sending Event to 0x34A860: kEventWindowBoundsChanged, 0x34A890 "text.tcl"
Called handler 0x93154E24. Event was NOT handled
Leaving target 0x34A860 with result -9874
SendEventToEventTarget entered
Sending Event to 0x321930: etrg 1
Leaving target 0x321930 with result -9874
Sending Event to 0x321930: kEventWindowBoundsChanged, 0x34A890 "text.tcl"
Leaving target 0x321930 with result -9874
SendEventToEventTarget entered
SendEventToEventTarget entered
Sending Event to 0x34A860: etrg 1
Leaving target 0x34A860 with result -9874
Sending Event to 0x34A860: kEventWindowTransitionCompleted, 0x34A890 "text.tcl"
Leaving target 0x34A860 with result -9874
SendEventToEventTarget entered
Sending Event to 0x321930: etrg 1
Leaving target 0x321930 with result -9874
Sending Event to 0x321930: kEventWindowTransitionCompleted, 0x34A890 "text.tcl"
Leaving target 0x321930 with result -9874
Called handler 0x931552E8. Event was handled
Leaving target 0x34A860 with result 0
Called handler 0x9311F44C. Event was handled
Leaving target 0x321930 with result 0


Thanks,

-Oscar

On Jul 27, 2005, at 11:58 PM, Finlay Dobbie wrote:

On 7/27/05, Oscar Bonilla <email@hidden> wrote:

I have a problem where if the OS moves my window (because it was
mapped at 0,0 under the menubar and the user moved the dock) my
coordinates get out of sync.

I was reading http://lists.apple.com/archives/carbon-development/ 2001/
Apr/msg00161.html and I believe that is exactly what I'm getting.


However, if I listen for the kEventClassWindow/kEventWindowConstrain
event, I never get it. Which event should I be getting when the OS
moves my window?


kEventWindowBoundsChanged?

 -- Finlay


-- pgp fingerprint: BC64 2E7A CAEF 39E1 9544 80CA F7D5 784D FB46 16C1

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden
References: 
 >When the OS moves my window, what event should I get? (From: Oscar Bonilla <email@hidden>)
 >Re: When the OS moves my window, what event should I get? (From: Finlay Dobbie <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.