RE: Programmatically create view and handle events

2011-01-27 Thread Shawn Bakhtiar
/Articles/ocrtHowMessagingWorks.html#//apple_ref/doc/uid/TP40008048-CH104 > Date: Thu, 27 Jan 2011 10:45:52 +0100 > From: lucataro...@gmail.com > To: witness.of.teacht...@gmx.net > CC: Cocoa-dev@lists.apple.com > Subject: Re: Programmatically create view and handle events > >

Re: Programmatically create view and handle events

2011-01-27 Thread Luca Tarozzi
Uli, Thanks for your patient! I know that this snippet seems without any sense; my point is only on "handling events". I was trying to handle a drawRect: on a view created dynamically. Let me explain: I come from .NET, where there is a completely different approach, especially about creating cont

Re: Programmatically create view and handle events

2011-01-27 Thread Uli Kusterer
On Jan 27, 2011, at 10:28 AM, Uli Kusterer wrote: > The thing to keep in mind when creating views programmatically is that > they're just normal objects, so you just create them, use addView to insert > them in the hierarchy on the screen That should of course be addSubview:. I blame lack of te

Re: Programmatically create view and handle events

2011-01-27 Thread Uli Kusterer
On Jan 26, 2011, at 5:29 PM, Luca Tarozzi wrote: > I am new to cocoa and objective C. Hi and welcome to Cocoa! I'm sure you'll have fun! The learning curve at the start is a bit steep, but don't worry, it'll get easier after a while :-) > I am looking for a way to handle events for a NSView cre

Re: Programmatically create view and handle events

2011-01-26 Thread Luca Tarozzi
OK. Understand. Seems it's better if I read some more books... Luca Il giorno 27/gen/2011, alle ore 05.39, Kyle Sluder ha scritto: > On Wed, Jan 26, 2011 at 8:29 AM, Luca Tarozzi wrote: >> Hi all, >> >> I am new to cocoa and objective C. >> >> I am looking for a way to handle events for a

Re: Programmatically create view and handle events

2011-01-26 Thread Kyle Sluder
On Wed, Jan 26, 2011 at 8:29 AM, Luca Tarozzi wrote: > Hi all, > > I am new to cocoa and objective C. > > I am looking for a way to handle events for a NSView created > programmatically (without IB). These two statements are kind of at odds. If you're new to Cocoa and Objective-C, why are you fi

Programmatically create view and handle events

2011-01-26 Thread Luca Tarozzi
Hi all, I am new to cocoa and objective C. I am looking for a way to handle events for a NSView created programmatically (without IB). Is it possible starting from the following code? - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { // Insert code here to initialize yo