• 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: Scrolling Text Field Class for Logging?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scrolling Text Field Class for Logging?


  • Subject: Re: Scrolling Text Field Class for Logging?
  • From: Dave <email@hidden>
  • Date: Sat, 21 Mar 2015 12:01:28 +0000

Hi,

That sort of works - here is the code:

myVisibleRect = [[self.pFloatingWindowMonitorScrollView documentView] visibleRect];
myVisibleScrollY = NSMaxY(myVisibleRect);

myFrameRect = [[self.pFloatingWindowMonitorScrollView documentView] frame];
myFrameScrollY = NSMaxY(myFrameRect);

if (myFrameScrollY <= myVisibleScrollY)
	return;							//******** Return1

myScrollPoint.x = 0;
myScrollPoint.y = [myMonitorTextStorage length];

[self.pFloatingWindowMonitorScrollView.contentView scrollPoint:myScrollPoint];

When I run this, it returns a “Return 1” above until it gets to the bottom on the view, then it runs code that sets the Scroll Point to the End, which is fine, however, now if I click in the Scroller to see something Scrolled towards the beginning, I want it to stop Auto-Scrolling until the User Scrolls to the end again.

Any ideas? I’m looking at using the Value of the Vertical Scroller and compare against this.

Cheers
Dave

> On 20 Mar 2015, at 22:21, Jerry Krinock <email@hidden> wrote:
>
>
> On 2015 Mar 20, at 14:24, Dave <email@hidden> wrote:
>
>> how do you check the Scroll Position for being at the end?
>
>
> I would try comparing
>   NSMaxY([[myScrollView documentView] visibleRect])
> with
>   NSMaxY([[myScrollView documentView] frame])
>
> If that doesn’t work, try NSMinY instead.  In simple cases, it’s usually easier to try both ways than to try and remember how flippedness works.
>
> For margin, add a few points to your comparison to weight it on the side of “is at the end”.
>
>
>
> _______________________________________________
>
> 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


References: 
 >Scrolling Text Field Class for Logging? (From: Dave <email@hidden>)
 >Re: Scrolling Text Field Class for Logging? (From: Jens Alfke <email@hidden>)
 >Re: Scrolling Text Field Class for Logging? (From: Dave <email@hidden>)
 >Re: Scrolling Text Field Class for Logging? (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: Core Data Model Editor without Core Data
  • Next by Date: Re: Core Data Model Editor without Core Data
  • Previous by thread: Re: Scrolling Text Field Class for Logging?
  • Next by thread: Experiences using Chromium Embedded Framework?
  • Index(es):
    • Date
    • Thread