Re: A question about NSPredicateEditor and NSPredicateEditorRowTemplate
Re: A question about NSPredicateEditor and NSPredicateEditorRowTemplate
- Subject: Re: A question about NSPredicateEditor and NSPredicateEditorRowTemplate
- From: David Hoerl <email@hidden>
- Date: Fri, 06 Mar 2009 09:42:41 -0500
[following up to a Jan 08 thread]
> is it possible to modify the width of the NSTextField representing
a "Number" in a NSPredicateEditorRowTemplate ?
Yes, but not yet in Interface Builder. To do so programatically, get
the row template, get the text field as the last member of the row
template's templateViews array, and set its frame to the size you want.
I hope that helps,
-Peter
Peter, I tried to do as you suggest - set the frames to what I want,
but it has no effect. Any other suggestions?
David
PS: code
-applicationDidFinishLaunching
...
int i = 0;
NSArray *temps = [predicateEditor rowTemplates];
for(NSPredicateEditorRowTemplate *temp in temps) {
NSArray *views = [temp templateViews];
int j = 0;
int x = 0;
for(NSControl *view in views) { // I know, view is not a good
name for this :-)
NSLog(@"temp=%@ view=%@ frame: %@", temp, view,
NSStringFromRect([view frame])); // verify all is connected
if(i==0) continue; // don't touch first one
NSRect r = [view frame];
r.origin.x = 0; // just for testing impact...
[view setFrame:r];
NSLog(@" mod frame=%@", NSStringFromRect([view frame]));
// yes, it took
++j;
}
++i;
}
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden