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: Removed view still getting events



On Sep 28, 2006, at 1:41 PM, j o a r wrote:


On 28 sep 2006, at 22.28, John Nairn wrote:

Is there a proper way to remove a view and stop it from getting events? Maybe it is subview of something else too?

I don't think that's possible.

What is it that triggers you to remove the view? Are you doing it in the middle of some mouse event, or from something not related to user input events in the window?

j o a r

I have a window controller for graphics output of scientific calculations. There is a scroll view and a view for the graphics. When the scroll view awakes from the nib, it sets the graphics view to its document view.


I am extending my software now to do 3D calculations. I want to reuse most of the current window controller and just replace the scroll view and graphics view by a new scroll view with an NSOpenGLView subclass as its document view. It works, but the original graphics view continues to get events. If I remove that view, those events cause a crash. If I retain it before removing it, I can see the events reaching that object. It would be better to have the view removed from the responder chain because those events will not make sense to the planned 3D output.

All this changes are done when the window first opens (in windowDidLoad). It opens fine but a crash occurs when the mouse is moved.

I thought of making a separate nib file for the 3D view, but the previous nib file has a lot of other elements (e.g. drawers, dialog boxes, tool bar elements, etc.) that should be the same and I want to reuse them as is.

---------------
John Nairn (1-541-737-4265, FAX:1-541-737-3385)
Professor and Richardson Chair
Web Page: http://woodscience.oregonstate.edu/faculty/Nairn
FEA/MPM Web Page: http://oregonstate.edu/~nairnj



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

This email sent to email@hidden
References: 
 >Removed view still getting events (From: John Nairn <email@hidden>)
 >Re: Removed view still getting events (From: j o a r <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.