• 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: NSView + NSScrollView, not scrolling
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSView + NSScrollView, not scrolling


  • Subject: Re: NSView + NSScrollView, not scrolling
  • From: Stephane Sudre <email@hidden>
  • Date: Sat, 05 May 2012 03:24:54 -0700

A question that could give a better idea of the issue:

Is the scroller thumb visible?

On Sat, May 5, 2012 at 12:31 AM, qvacua <email@hidden> wrote:
> I have got a very basic question about NSScrollView. I embedded my
> custom NSView into an NSScrollView using Xcode's "Embed In..." menu
> item. The following is my custom NSView:
>
> @implementation MyView
>
> - (void)drawRect:(NSRect)dirtyRect {
>    [[NSColor yellowColor] set];
>    NSRectFill([self frame]);
> }
>
> - (void)keyDown:(NSEvent *)theEvent {
>    unichar key = [[theEvent characters] characterAtIndex:0];
>    NSLog(@"\\U%X pressed", (int)key);
>
>    [self interpretKeyEvents:[NSArray arrayWithObject:theEvent]];
> }
>
> - (BOOL)acceptsFirstResponder {
>    return YES;
> }
> @end
>
> In "applicationDidFinishLaunching:" I set the frame size of the view
> to something big using setFrameSize.
>
> What I want — but now working — is scrolling via Page Up/Down key. If
> I understand the doc correctly, I just have to call
> "interpretKeyEvents:" like above  and since MyView does not respond to
> appropriate messages, the responder chain will forward the messages to
> the scroll view. However, it does not scroll. What am I missing?
>
> Thanks in advance.

_______________________________________________

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


  • Follow-Ups:
    • Re: NSView + NSScrollView, not scrolling
      • From: qvacua <email@hidden>
References: 
 >NSView + NSScrollView, not scrolling (From: qvacua <email@hidden>)

  • Prev by Date: NSView + NSScrollView, not scrolling
  • Next by Date: Re: NSView + NSScrollView, not scrolling
  • Previous by thread: NSView + NSScrollView, not scrolling
  • Next by thread: Re: NSView + NSScrollView, not scrolling
  • Index(es):
    • Date
    • Thread