Re: I want a scrollbar
Re: I want a scrollbar
- Subject: Re: I want a scrollbar
- From: Steve Martin <email@hidden>
- Date: Mon, 4 Nov 2002 11:26:14 +1100
Message: 2
Date: Sun, 3 Nov 2002 14:18:04 -0600
Subject: I want a scrollbar
From: Steve Mills <email@hidden>
To: email@hidden
I'm having a helluva time trying to figure out how to get a horizontal
scrollbar to show up in my NSView subclass.
The first thing I tried, naturally, was to subclass from NSScrollView
instead of NSView, then turn on the scrollbar in my initWithFrame
routine. It worked (it added the scrollbar), but then my drawRect
seemed to draw nothing.
So do I need to do something like install an NSScrollView in the
window, and then install my custom view into that NSScrollView? I also
this is how it is shown in the examples - it has worked for me.
can't figure out how to tell the NSScrollView the size of its
non-clipped view so the scrollbar will activate.
you can set the initial size in Interface builder. You must also make
sure your contained view is not 'sprung' to expand to the surrounding
window size. Otherwise, it will always grow to fill the scrollview
and you will never see the scrollers activated.
Steve Martin
Even more puzzling is how custom classes are used in Interface Builder.
If I open the BezierPath Lab Cocoa example, and open the MainMenu.nib,
open the Window, and click on the scroll view control, it shows it as
being a BezierView class. But if I then look at the custom class info
(command-5), it says it's an NSScrollView. Why is it showing it to be 2
different classes (although BezierView is a subclass of NSScrollView)?
Interface Builder is probably the most confusing, yet powerful dev tool
I've ever used. I love half of it and hate the other half. :)
Steve Mills
Drummer, Mac geek
http://sjmills5.home.mchsi.com/
_______________________________________________
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.