Re: Newbie: Alignment and resizing of window
Re: Newbie: Alignment and resizing of window
- Subject: Re: Newbie: Alignment and resizing of window
- From: Dimitri Bouniol <email@hidden>
- Date: Mon, 21 Aug 2006 13:46:24 -0700
Hi all!
I can't figure out how to configure my button in my Interface.
I have a button down in bottom right corner and when I test my
interface and resize my window my button does not move. I want it
to "follow" the botton right corner when I resize, how do I do that?
This one is easy. Select your button, then go to Tools > Show
Inspector in the menu bar. In the Pop-up button at the top of the
inspector, select "Size". In the auto-resize box, a strait line meens
that that value will remain static/fixed, so if you want the button
to stay at the bottom right, just click the top and left bar to make
them into springs. If your button is inside a view, apply this
technique to the view instead.
Second of all
I'm using NSTableView for the first time is there a good tutorial
or a good info page?
You might try to look at http://www.cocoadevcentral.com/. They have
some pretty good tutorials.
Basically, you want to have an object in your nib that will serve as
a 'datasource' for the table view. You sould connect your object to
the datasource outlet of the NSTableView. Be sure to select the
NSTableView, and not the NSScrollView. The, in your object, implement
the following methods:
- (int)numberOfRowsInTableView:(NSTableView *)aTableView
and
- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:
(NSTableColumn *)aTableColumn row:(int)rowIndex
In the first one, you will tell the table view how many rows are in
your table view
example:
- (int)numberOfRowsInTableView:(NSTableView *)aTableView
{
return [myMutableArray count];
}
In the second one, you will tell the table view what will be
displayed in each table cell. Also, in interface builder, give each
table column a specific identifier, so you can know which one your
working with. Also, you mutable array should be filled with
descriptor objects, that have methods to access each record.
example:
- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:
(NSTableColumn *)aTableColumn row:(int)rowIndex
{
if ([[aTableColumn identifier] isEqualToString:@"Name"]) {
return [[myMutableArray objectAtIndex:rowIndex] name];
}
if ([[aTableColumn identifier] isEqualToString:@"Age"]) {
return [[myMutableArray objectAtIndex:rowIndex] age];
}
return;
}
Finally, to refresh your table view, send [tableView reloadData]; to it.
See http://developer.apple.com/documentation/Cocoa/Conceptual/
TableView/Tasks/UsingTableDataSource.html#//apple_ref/doc/uid/
20000117-BBCBHIJJ for more info.
--
The world's biggest Apple fan,
Dimitri Bouniol
email@hidden
_______________________________________________
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