• 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: Resizable field editor in NSTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Resizable field editor in NSTableView


  • Subject: Re: Resizable field editor in NSTableView
  • From: Andre <email@hidden>
  • Date: Fri, 2 Sep 2005 05:09:51 +0900

Yes, this is correct.
An active textfield cell is actually within a special private scrollview _NSKeyboardFocusClipView,
if you traverse the view hierarchy you'll run into it.


In your example, what is "self"? Is it an NSTextView or the cell or ...?

If its the cell or even NSText, try [[self superview] setFrameSize:size];
You'll wanna traverse the view hierarchy and when you run into _NSKeyboardFocusClipView
thats the one to change IIRC. Also, _NSKeyboardFocusClipView wont resize unless its
first responder IIRC.


I had the same problem, and I'm not sure exactly how your doing it...

Since your in a table view, why don't you just bypass the cell/ scrollview resizing
and change the height of the row appropriately calling setNeedsDisplay:YES to the
table view afterwards?


Hope it helps...

On 平成 17/09/01, at 23:59, Dave Rosborough wrote:


Thanks for the suggestion!

I have most of it working, except I'm struggling to get the scrollview itself to resize correctly as the user enter text. Just doing:

[self setFrameSize:[[myTextView textStorage] size]];

in the scrollview when an NSTextDidChangeNotification is posted doesn't work, and I couldn't find any other obvious way to do that.

Any help would be greatly appreciated!

Thanks,
Dave Rosborough

On 31-Aug-05, at 5:01 PM, Andre wrote:




You need to add an auxiliary view to the field editor by replacing it with a custom subclass.
What I did was create a custom scrollview, add a text view in it, use the scrollview to resize the enclosing
textview, and use forward invocation to call all the other methods sent to the field editor past the enclosing
view to its real destination.
Its possible thanks to Objective-C runtime.


On 平成 17/09/01, at 8:17, Dave Rosborough wrote:




I was wondering if anyone has any tips on getting a field editor to resize during editing in an NSTableView? I've got a table view with variable row heights working correctly using tableView:heightOfRow: , but I would really like to be able to resize the row (or at least the field editor until editing is complete) while the user is entering text. I've been looking through the archives and searching the web, but have come up dry. Any pointers?










_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Prev by Date: Re: OT: how do you protect your software?
  • Next by Date: [ANN] Next CocoaHeads: Sep 8. New Chapter in Portland, OR (Sep 13)
  • Previous by thread: MailTemplate needs new developer
  • Next by thread: [ANN] Next CocoaHeads: Sep 8. New Chapter in Portland, OR (Sep 13)
  • Index(es):
    • Date
    • Thread