Re: NSImageView inside NSScrollView
Re: NSImageView inside NSScrollView
- Subject: Re: NSImageView inside NSScrollView
- From: Tobias Hermann <email@hidden>
- Date: Sun, 25 May 2003 18:31:33 +0200
send scrollRectToVisible: to e.g. your scrollView...
or NSClipView's scrollToPoint:
You have access to the clipView with
[yourScrollView contentView]
With these two methods you should not have to alter the NSSCroller's.
NSClipView and/or NSSrollView should do all that for you properly.
regards.. Tobi
On Sunday, May 25, 2003, at 05:30 PM, Rolf wrote:
Thnaks!
That works. Now I have the NSImageview inside the NSScrollview. But
how do I scroll
the image programatically ? I can get the instance pointer to the
NSScroller's and set their
position using [scroller setFloatValue] method. This moves the
scroller knobs, but nothing
happens to the image. I guess there must be some "update" method in
NSImageView or
NSScrollView that will force them to re-read the scroller position,
but I haven't found any -
except NSScrollView's reflectScrolledClipView which isn't right.
/Rolf
23.05.2003 19:01:18, skrev publiclook <email@hidden>:
Use Interface Builder's Layout->Make Subviews Of->Scroll View menu
item.
When you programmatically create the scroll view, you need to make the
scroll view a sub view of some other view or the scroll view can
never
be displayed.
On Friday, May 23, 2003, at 10:29 AM, Rolf wrote:
Hi,
I have a wide jpeg NSImage in a NSImageView that is much narrower. I
need to programatically "slide" the jpeg horizontally inside the
NSImageView, pixel by pixel. NSImageView does not seem to have any
methods for positioning the NSImage inside itself (except for
left/right/center). I
think the solution is to place the NSImageView inside a NSScrollView,
turn off its sliders, and use NSScrollView methods for sliding the
jpeg back and forth. Am I correct ? I did not find NSScrollView on
the
palettes pane of IB so I guess it has to be created programatically.
When the following code is run the entire NSImageView (imgSlider)
just
"vanishes".
NSScrollView *scrollview = [[NSScrollView alloc]
initWithFrame:[imgSliding frame]];
[scrollview setDocumentView:imgSliding];
What's wrong ?
/Rolf
_______________________________________________
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.
_______________________________________________
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.
_______________________________________________
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.
_______________________________________________
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.