• 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: NSTextView offset of text at top of view
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextView offset of text at top of view


  • Subject: Re: NSTextView offset of text at top of view
  • From: Steve Palmer <email@hidden>
  • Date: Sun, 21 Mar 2004 17:00:03 -0800

Unfortunately that doesn't work:

[textView pageDown:self];
NSRect bounds = [textView bounds];
NSRect visible = [textView visibleRect];
NSLog(@"Bounds = %d,%d, Visible = %d,%d", bounds.origin.x,
bounds.origin.y, visible.origin.x, visible.origin.y);

I get (0,0) for both bounds and visibleRect on some long text which has
already scrolled. I probably need to spend more time digging into the
offset functions since there's probably some combination that will get
me what I need.
Thanks.




On Mar 21, 2004, at 4:37 PM, Allan Odgaard wrote:

> On 22. Mar 2004, at 0:44, Steve Palmer wrote:
>
>> [...] if the textview is at the last page, I want to detect that so I
>> can load the textview with another message instead. So specifically I
>> was looking for something like [NSText visibleRange] but that doesn't
>> exist.
>
> I doubt such a method exists -- but maybe you can use visibleRect and
> compare it to the bounds rect? that would also give you an indication
> about when you hit the last page.
>
>
>
> ** Cocoa FAQ: <http://www.alastairs-place.net/cocoa/faq.txt> **
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: NSTextView offset of text at top of view
      • From: Allan Odgaard <email@hidden>
References: 
 >NSTextView offset of text at top of view (From: Steve Palmer <email@hidden>)

  • Prev by Date: Playing MIDI Sounds
  • Next by Date: Cocoa iTunes plugin?
  • Previous by thread: NSTextView offset of text at top of view
  • Next by thread: Re: NSTextView offset of text at top of view
  • Index(es):
    • Date
    • Thread