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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to