[Prev] Thread [Next]  |  [Prev] Date [Next]

Is anyone using IKImageView? Brian Postow Mon Mar 22 10:00:09 2010

I'm trying to write a couple of applications with an IKImageView with 
scrollbars. The docs say that it should have scrollbars, but I haven't been 
able to get them to work. I'm currently putting  the IKImageView inside a 
subclass of NSScrollView with the following change:

- (void)reflectScrolledClipView:(NSClipView *)cView;
    NSView *_imageView = [self documentView];
    [super reflectScrolledClipView:cView];
    if ([_imageView isKindOfClass:[IKImageView class]] &&
                [[self contentView] isKindOfClass:[IKImageClipView class]] &&
                [[self contentView] respondsToSelector:@selector(docRect)]) {
                NSSize docSize = [(IKImageClipView *)[self contentView] 
                NSSize scrollViewSize = [self contentSize];
                // NSLog(@"doc %@ scrollView %@", NSStringFromSize(docSize), 
                if (docSize.height > scrollViewSize.height || docSize.width > 
                        ((IKImageView *)_imageView).autohidesScrollers = NO;
                        ((IKImageView *)_imageView).autohidesScrollers = YES;

This works for displaying/hiding the scrollbars and scrolling correctly. 

1) if it shows either scrollbar, it takes up the screen real estate for both, 
even if it  doesn't actually show the second scrollbar. (because the 
work-around either "auto-hides" or it doesn't)

2) and MUCH worse, the scrollview seems to confuse the IKImageView when it 
comes to the select tool. If the image isn't EXACTLY the height of the 
scrollView,  and you try to select a region with the select tool, the select 
box is not in the correct location. The x coordinate is fine, but the height is 

I think that this has something to do with isFlipped, (because it's only in the 
y dimension) but I haven't figured out what it is doing yet.

Has anyone experienced this? and if so, how do I get around it?


Brian Postow
Senior Software Engineer
Acordex Imaging Systems

Do not post admin requests to the list. They will be ignored.
Quartz-dev mailing list      ([EMAIL PROTECTED])
Help/Unsubscribe/Update your Subscription:

This email sent to [EMAIL PROTECTED]