• 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: Can't resize Floating-Number NSTextfield in NSPredicateEditor.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can't resize Floating-Number NSTextfield in NSPredicateEditor.


  • Subject: Re: Can't resize Floating-Number NSTextfield in NSPredicateEditor.
  • From: Dave DeLong <email@hidden>
  • Date: Fri, 13 Aug 2010 07:39:43 -0600

This is only resizing the textfield of the row *template*, not the row itself. I've found that the easiest way to do what you're wanting is to subclass NSPredicateEditorRowTemplate and override the templateViews method. In that method you'll invoke super's implementation, then alter the frame of the last view in the array (just like you posted), and then return the array.

Don't forget to change the row class in IB either!

Dave DeLong

Sent from my iPhone

On Aug 13, 2010, at 7:33 AM, Gustavo Pizano <email@hidden> wrote:

> Hello all, I come to you asking for humble guidance.
>
> after reading the way to resize the TextFields in some other topic, I tried myself, without success..
>
> This is what I have.
>
> A parent view which display the panel that contains the predicate editor, this predicate editor controller  (NSWindowController) has an @property (assign) pointing to the parent controller. In the parent controller I have a NSPredicate ivar which at the moment before initializing the panel, I initialize it with a Default Predicate.
>
> In IB, I set via Bindings the value for the predicate editor to _parentController.predicate.
>
> So when I run and click the button that display the panel, the panel appears and the predicate editor is there with the default predicate I set up. So far so Good.
>
> But I can' t rezise the NSTextField view of a Floating-Double number, in my PanelController on the awakefromNib method I added this code:
>
>    NSArray    * rtemplates = [pe rowTemplates];
>    for(NSPredicateEditorRowTemplate * peRT in rtemplates){
>        if([peRT rightExpressionAttributeType] == NSDoubleAttributeType){
>            NSView * v = [[peRT templateViews] lastObject];
>            if([v isKindOfClass:[NSTextField class]]){
>                NSRect frame = [v frame];  // comment 1
>                frame.size.width = 200;
>                [v setFrame:frame];
>
>            }
>        }
>    }
>
> I set a Breakpoint into  //comment 1, and I get the size of the field which is 25, then as you see I set it up to 200 and re-set the frame property.
>
> But nothing happens I still see that field with the small size ....
>
>
> What can I do?, what am I missing?... I have tried moving the code above to different methods such as the initWithNibName:, just testing ... with no good results either.
>
>
> thanks
>
> Gustavo
>
>
> _______________________________________________
>
> 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
_______________________________________________

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: Can't resize Floating-Number NSTextfield in NSPredicateEditor.
      • From: Gustavo Pizano <email@hidden>
    • Re: Can't resize Floating-Number NSTextfield in NSPredicateEditor.
      • From: Gustavo Pizano <email@hidden>
References: 
 >Can't resize Floating-Number NSTextfield in NSPredicateEditor. (From: Gustavo Pizano <email@hidden>)

  • Prev by Date: Can't resize Floating-Number NSTextfield in NSPredicateEditor.
  • Next by Date: Re: Can't resize Floating-Number NSTextfield in NSPredicateEditor.
  • Previous by thread: Can't resize Floating-Number NSTextfield in NSPredicateEditor.
  • Next by thread: Re: Can't resize Floating-Number NSTextfield in NSPredicateEditor.
  • Index(es):
    • Date
    • Thread