• 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: 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


  • Follow-Ups:
    • Re: A question about NSPredicateEditor and NSPredicateEditorRowTemplate
      • From: Peter Ammon <email@hidden>
  • Prev by Date: Re: NSStatusItem when clicked shows custom view
  • Next by Date: Newbie query re notifications
  • Previous by thread: NSToolbar EXC_BAD_ACCESS after configuration (leopard)
  • Next by thread: Re: A question about NSPredicateEditor and NSPredicateEditorRowTemplate
  • Index(es):
    • Date
    • Thread