RE: Custom view - newbie stumped
RE: Custom view - newbie stumped
- Subject: RE: Custom view - newbie stumped
- From: "Kenny Millar" <email@hidden>
- Date: Mon, 24 Apr 2006 17:13:48 +0100
- Organization: Kenny Millar
> This could happen e.g. if you used the "Instantiate" menu item to create
a top-level instance of your view in your window in addition to the instance
you created in the window.
Thanks - that helped me understand where I went wrong, when I connected the
button to the action, I control-dragged from the Button to the TLView class
under 'classes', rather then control-dragging it to the custom view.
Many thanks - it's working now!
-Kenny
_____
From: M. Uli Kusterer [mailto:email@hidden]
Sent: 24 April 2006 17:00
To: Kenny Millar
Cc: email@hidden
Subject: Re: Custom view - newbie stumped
On 24/04/06, Kenny Millar <email@hidden> wrote:
I placed a button on the window and connected it to the 'addTrack'
action.
I placed a Custom View on the window and set it's custom class to be
'TLView'
Either you swapped the order of these two items (how can you connect a
button to addTrack: before you even create the custom view?), or you have
created two TLView instances, and you're looking at one, but addTrack: gets
sent to the other one.
This could happen e.g. if you used the "Instantiate" menu item to create a
top-level instance of your view in your window in addition to the instance
you created in the window. What that does is create *two* views, one as a
window-less view that will thus never be shown (but could be handy if you
wanted to add it to another window programmatically, later), and the other
as a view in the window.
Another guess: Have you hooked up the button to an actual view instance? If
you've hooked it up to the First Responder, the message will not be sent to
your view because your view doesn't say it can be first responder (and even
if it did, you would have to click it or so to give it first responder
status ("keyboard focus")). if you have an NSLog() in addTrack: and it isn't
called, that could be the case. If it *is* called, you could have the two
objects.
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden