home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!gatech!prism!xray.gatech.edu!cc100aa
- From: cc100aa@xray.gatech.edu (Ray Spalding)
- Newsgroups: comp.sys.next.programmer
- Subject: Re: SCROLLVIEW DESPERADO
- Keywords: documentView, NXImage, Please Help because Hyperupic wants new features
- Message-ID: <67172@hydra.gatech.EDU>
- Date: 29 Aug 92 02:06:24 GMT
- References: <1992Aug24.180943.16637@Princeton.EDU>
- Sender: news@prism.gatech.EDU
- Organization: Georgia Institute of Technology
- Lines: 48
-
- In article <1992Aug24.180943.16637@Princeton.EDU> writes:
- >Hello again! I will try another plea for some ScrollView wisdom:
- > [...]
- > anImageView = [[ImageView alloc] init];
-
- Notice that the "init" method for a View makes a zero-by-zero frame
- rectangle. If you're going to use "init" rather than "initFrame",
- you'll need to use "sizeTo::" later on.
-
- > [contentView drawSelf:&imageRect :1];
-
- Don't call drawSelf:: directly. Use one of the "display" methods.
-
- >- drawSelf:(const NXRect *)rects :(int)rectCount {
- > [super drawSelf:rects :rectCount];
- > [contentView drawSelf:&imageRect :1];
- > return self;
- >}
-
- You don't need the above. The "display" machinery will call "drawSelf::"
- for the Views needed.
-
- >- setpict: (char *) path {
- > if ( [imagerep useFromFile:path] == NO )
- > return nil;
- > return self;
- >}
-
- In the above, you could add:
- NXSize sz;
- /* ... */
- [imagerep getSize:&sz];
- [self sizeTo:sz.width:sz.height];
-
- It might be more straightforward, though, to redesign all this so
- that you get your NXImage (and it's size) before you allocate and
- initialize the ImageView.
-
- >- drawSelf:(const NXRect *)rects :(int)rectCount {
- > [imagerep composite:NX_COPY fromRect:rects toPoint:&(rects->origin)];
-
- "composite:fromRect:toPoint" is intended to composite a sub-rectangle
- of your image. Better here to use:
- [imagerep composite:NX_COPY toPoint:&bounds.origin];
- --
- Ray Spalding, Office of Information Technology
- Georgia Institute of Technology, Atlanta Georgia, 30332-0715
- Internet: ray.spalding@oit.gatech.edu (NeXT Mail accepted)
-