Re: Creating/Populating Windows programatically
Re: Creating/Populating Windows programatically
- Subject: Re: Creating/Populating Windows programatically
- From: Matt Neuburg <email@hidden>
- Date: Wed, 31 May 2006 10:26:13 -0700
- Thread-topic: Creating/Populating Windows programatically
On Wed, 31 May 2006 12:02:01 -0400, gnat <email@hidden> said:
> I have found a few references to creating windows (notably the full
>screen app walkthrough at cocoadevcentral), but I have not found
>anything that gives a good end to end example of creating a window
>and adding objects to it (though I have gathered that I need to
>create a view and put the objects in the view)
Not sure what you mean by "objects". A control, for example, such as a
button, *is* a view. You are simply constructing the view hierarchy:
<http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaViewsGuide/W
orkingWithAViewHierarchy/chapter_4_section_5.html>
So, to put a made-from-scratch button in a window programmatically, you
alloc, init (meaning initWithFrame), do anything else that sets up the
behavior and look of the button, and addSubview. (And now release the
original button, since the superview is retaining it.) In effect, what
Interface Builder can do, you can do.
>as well as how to do
>all the binding stuff that IB does for you
I have never noticed IB doing any binding stuff for me. I can create
bindings in IB, but I'm the one doing it. And again, what you can do in IB,
you can do in code.
Every setting in IB is merely a graphical representation of a command that
you can give in code. m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
_______________________________________________
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