Re: Matrix of NSTextFields (creating it in IB)
Re: Matrix of NSTextFields (creating it in IB)
- Subject: Re: Matrix of NSTextFields (creating it in IB)
- From: Esteban <email@hidden>
- Date: Sun, 24 Jun 2001 11:49:09 -0700
On Saturday, June 23, 2001, at 10:56 PM, email@hidden wrote:
Hello,
I hate to ask such simple questions but this is driving me nuts, I
can't seem to figure out what I am doing wrong. I am working my way
through the "ToDo" tutorial in the O'Reilly Cocoa book and now on the
part where I hookup the outlets and actions for the "ToDoDocument" on
page 263. I can't seem to hookup the 'itemList' and 'statusList' text
fields as a NSMatrix. When I open up the example code from O'Reilly's
website I noticed that the NSTextFields appear grouped but as of yet I
have been unable to replicate this. I did try the Layouts->Group
In->Custom View (and select NSMatrix as the custom class) but this was
just a shot in the dark (voodoo). When I added the NSTextFields to the
window I first dragged a NSTextField from the palette to the window,
resized it, and then option dragged to make a duplicate (as I
understood the instruction at the bottom of 262). Is there something
missing in my dragging technique?
Thanks,
Ryan
I haven't seen the Learn Cocoa examples but I think I can follow what
you're trying to do.
What you need to do in Interface Builder is double click inside the
NSMatrix. It will then be highlighted with a thick border, and you can
then drop in NSTextField. Its easier to place several NSTextFields in
the window or panel, and when you are done you can select them all and
go to Layouts->Group In->Custom View and then use the inspector to
change the custom view to an NSMatrix. Then you can make your outlet
connections :)
I hope that helped.
Also, a nice way of grouping text fields is NSForm. I wrote an example
on extending NSForm to have more than 2 fields, with code in Project
Builder. Here's the link to the example
http://homepage.mac.com/codescape/CocoaExamples/nsformExample.tar.gz
-Esteban
email@hidden