Ask a Question related to Mac Programming, Design and Development.
-
matt neuburg #1
Re: Scrolling a NSScrollView to the bottom
In <hraftery-2FB90A.21082003082003@seagoon.newcastle.edu.au> Heath
Raftery wrote:reflectScrolledClipView. But, you shouldn't be bossing the clipView> I've embeded a NSScrollView in my app, which is filled with the
> contents of a text file. This text file is typically large, and I
> want to have the scroller at the bottom by default. Here's what I'm
> using at present:
>
> NSPoint bottomOfDocument = {0, 9999999};
> bottomOfDocument = [[sMessages contentView]
> constrainScrollPoint:bottomOfDocument];
> [[sMessages contentView] scrollToPoint:bottomOfDocument];
>
> This works, however the scroller position widget (the blue/graphite
> glob in the scroller) remains at the top, when the tabview with the
> NSScollView is made visible. It goes immediately to the bottom if the
> scroller's up arrow is clicked, but on first glance it is not obvious
> that the bottom of the file is being shown.
>
> Any suggestions on getting the widget to update, or a cleaner way of
> doing same?
around this way; leave it alone and let it do its job. It's the
documentView you want to move. I take it you are saying you've got an
NSTextView, so scrollRangeToVisible is an easy reliable way to scroll it,
or you can use any of a number of NSView commands. Basically it's just a
matter of RTFM. m.
--
matt neuburg, phd = [email]matt@tidbits.com[/email], [url]http://www.tidbits.com/matt[/url]
REALbasic: The Definitive Guide! 2nd edition!
[url]http://www.amazon.com/exec/obidos/ASIN/0596001770/somethingsbymatt[/url]
Subscribe to TidBITS. It's free and smart.
matt neuburg Guest
-
Top/Bottom scrolling of table
Hello, I am trying to have the content inside of my table scroll top to bottom. Does any one know how to solve this issue. Here is the code for... -
Scroll Bar at bottom
I'm using a frame set and have a scroll bar at the bottom of the page I dont want. I assume this has to do with the page fitting into the browser. ... -
combination scrolling text scrolling picture and on MouseEnter function
it would help if you posted the code for us to look at... that way we can try to help ;) In article <bk6jip$ctm$1@forums.macromedia.com>, <... -
Custom Scroll Bar: Want to switch scrolling member, but keep scrolling intact.
Hey all. This is a juicy one. Simple Idea, Simple minded author can't find solution.... I have a text member in sprite 29. I have the "Custom... -
NSScrollView for NSTextView scrolls then snaps back
I have a text view created in IB that I use to display the contents of the clipboard by doing a paste into the text view. When the text is... -
Heath Raftery #2
Re: Scrolling a NSScrollView to the bottom
In article <20030803092849227-0700@news.la.sbcglobal.net>,
matt neuburg <matt@tidbits.com> wrote:
Thanks for the suggestions Matt. I'd had tried a few> In <hraftery-2FB90A.21082003082003@seagoon.newcastle.edu.au> Heath
> Raftery wrote:>> > I've embeded a NSScrollView in my app, which is filled with the
> > contents of a text file. This text file is typically large, and I
> > want to have the scroller at the bottom by default. Here's what I'm
> > using at present:
> >
> > NSPoint bottomOfDocument = {0, 9999999};
> > bottomOfDocument = [[sMessages contentView]
> > constrainScrollPoint:bottomOfDocument];
> > [[sMessages contentView] scrollToPoint:bottomOfDocument];
> >
> > This works, however the scroller position widget (the blue/graphite
> > glob in the scroller) remains at the top, when the tabview with the
> > NSScollView is made visible. It goes immediately to the bottom if the
> > scroller's up arrow is clicked, but on first glance it is not obvious
> > that the bottom of the file is being shown.
> >
> > Any suggestions on getting the widget to update, or a cleaner way of
> > doing same?
> reflectScrolledClipView. But, you shouldn't be bossing the clipView
> around this way; leave it alone and let it do its job. It's the
> documentView you want to move. I take it you are saying you've got an
> NSTextView, so scrollRangeToVisible is an easy reliable way to scroll it,
> or you can use any of a number of NSView commands. Basically it's just a
> matter of RTFM. m.
reflectScrolledClipView's in the meantime without success. Even with
your suggestions I was unable to get it working tonight, but that could
be put down to lack of sleep at this stage. I think what you've
demonstrated is what I always felt - I really don't understand the MVC
relationship well enough to do this stuff comfortably. I'll be taking
your advice by reading a few docs.
I've been working through O'Reilly's Building Cocoa Applications and
Apple Cocoa NSView etc. docs, without too many lightbulbs turning on
unfortunately. I guess, even though I am aware of the differences
between RAD and an environment like PB/IB, that I am still expecting
immediate results like I can achieve with Delphi and Borland C++ Builder.
Don't suppose you have any more specific suggestions on how someone, who
is quite confident programming in procedural and object-orientated
environments, can unravel the
NSView/NSTextView/NSClipView/NSDocumentView/NSScrollView paradigm?
Cheers,
Heath
--
Heath
__________________________________________________ ______
| *Nothing is foolproof to a sufficiently talented fool* |
| _\|/_ |
|________________________________________m(. .)m_________|
Heath Raftery Guest
-
matt neuburg #3
Re: Scrolling a NSScrollView to the bottom
In <hraftery-7214B3.00483005082003@seagoon.newcastle.edu.au> Heath
Raftery wrote:Actually I think the docs are very good. Always start with the topics.> Don't suppose you have any more specific suggestions on how someone,
> who is quite confident programming in procedural and object-
> orientated environments, can unravel the NSView/NSTextView/
> NSClipView/NSDocumentView/NSScrollView paradigm
For example the TextArchitecture concept files are really great, and
AboutScrollViews.html tells you about scroll views. Only then should you
read the NS***.html file, and when you do, don't forget to look at the
superclass right the way up the hierarchy. For example, beginners fail
to look at NSText when they are thinking about NSTextView. m.
--
matt neuburg, phd = [email]matt@tidbits.com[/email], [url]http://www.tidbits.com/matt[/url]
REALbasic: The Definitive Guide! 2nd edition!
[url]http://www.amazon.com/exec/obidos/ASIN/0596001770/somethingsbymatt[/url]
Subscribe to TidBITS. It's free and smart.
matt neuburg Guest
-
Heath Raftery #4
Re: Scrolling a NSScrollView to the bottom
In article <20030804122130773-0700@news.la.sbcglobal.net>,
matt neuburg <matt@tidbits.com> wrote:
Just a belated thank you note Matt. I've since got my scrollview> In <hraftery-7214B3.00483005082003@seagoon.newcastle.edu.au> Heath
> Raftery wrote:>> > Don't suppose you have any more specific suggestions on how someone,
> > who is quite confident programming in procedural and object-
> > orientated environments, can unravel the NSView/NSTextView/
> > NSClipView/NSDocumentView/NSScrollView paradigm
> Actually I think the docs are very good. Always start with the topics.
> For example the TextArchitecture concept files are really great, and
> AboutScrollViews.html tells you about scroll views. Only then should you
> read the NS***.html file, and when you do, don't forget to look at the
> superclass right the way up the hierarchy. For example, beginners fail
> to look at NSText when they are thinking about NSTextView. m.
happening nicely and have learnt quite a bit about the Cocoa
documentation system and text architecture. It actually turned out that
I had a logic error earlier in my program which was giving weird results
in the scrolling and throwing me off. For those interested, the
following works nicely:
[tMessages setString:myString];
myRange.location = [myString length];
[tMessages scrollRangeToVisible:myRange];
where tMessages is my IBOutlet NSTextView*.
--
Heath
__________________________________________________ ______
| *Nothing is foolproof to a sufficiently talented fool* |
| _\|/_ |
|________________________________________m(. .)m_________|
Heath Raftery Guest



Reply With Quote

