• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: A question about NSPredicateEditor and NSPredicateEditorRowTemplate
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A question about NSPredicateEditor and NSPredicateEditorRowTemplate


  • Subject: Re: A question about NSPredicateEditor and NSPredicateEditorRowTemplate
  • From: Peter Ammon <email@hidden>
  • Date: Fri, 6 Mar 2009 11:58:32 -0800


On Mar 6, 2009, at 6:42 AM, David Hoerl wrote:

[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;
}

David, the above code changes the frame origin, but not the frame width. Changing the frame origin will have no effect (the origins are controlled by NSPredicateEditor). But changing the width should have an effect.


-Peter


_______________________________________________

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


References: 
 >Re: A question about NSPredicateEditor and NSPredicateEditorRowTemplate (From: David Hoerl <email@hidden>)

  • Prev by Date: Performance degrades dramatically in [NSManagedObjectContext executeFetchRequest:error:]
  • Next by Date: Re: NSDrawNinePartImage draws slowly in CALayer
  • Previous by thread: Re: A question about NSPredicateEditor and NSPredicateEditorRowTemplate
  • Next by thread: Newbie query re notifications
  • Index(es):
    • Date
    • Thread