home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!wupost!bcm!aio!news
- From: bill@epnxt.jsc.nasa.gov
- Newsgroups: comp.sys.next.programmer
- Subject: Question about assigning a SoundView to a ScrollView
- Message-ID: <1992Aug14.145716.10438@aio.jsc.nasa.gov>
- Date: 14 Aug 1992 14:57:16 GMT
- Sender: news@aio.jsc.nasa.gov (USENET News System)
- Reply-To: bill@epnxt.jsc.nasa.gov
- Organization: nasa-jsc
- Lines: 73
-
- The follow code is from a quick palette I put together in which I was
- attempting to make a SoundView palette. It seems to work fine execpt in
- an actual application, I can not get the graphical portion of the sound
- file to show up on the the ScrollView.
-
-
- from the palette:
-
- -initFrame:(const NXRect *)frameRect
- {
- NXRect tempRect = *frameRect;
- int borderType = NX_NOBORDER;
-
- [super initFrame:frameRect];
- [ScrollView getContentSize:&tempRect.size
- forFrameSize:&frameRect->size
- horizScroller:YES vertScroller:NO borderType:borderType];
-
- theSoundView = [[SoundView alloc] initFrame:&tempRect];
-
- [self setHorizScrollerRequired:YES];
- [self setDynamicScrolling:YES];
- [self setDocView:theSoundView];
-
- [self setBackgroundGray:NX_WHITE];
- [self setBorderType:NX_BEZEL];
- [self setAutoresizeSubviews:YES];
- [self setAutosizing:NX_WIDTHSIZABLE|NX_HEIGHTSIZABLE];
-
- [[theSoundView superview] setAutoresizeSubviews:YES];
- [theSoundView setAutosizing:NX_HEIGHTSIZABLE];
-
- // [self setBackgroundColor:NX_COLORWHITE];
- [self setBorderType:NX_BEZEL];
- [self display];
- return self;
- }
-
-
-
- from my application:
-
- - openFile:(char *)fileName
- {
- id aSound;
-
- mySoundView = [ScrollView1 docView];
- [mySoundView setSound:[[Sound alloc] init]];
- aSound = [[Sound alloc] initFromSoundfile:fileName];
-
- [mySoundView setSound:aSound];
- [mySoundView setDisplayMode:SK_DISPLAY_WAVE];
- [ScrollView2 setDocView:mySoundView];
-
- [MyScrollWindow setTitleAsFilename:fileName];
- [MyScrollWindow setMiniwindowIcon: "SoundIcon"];
-
- [mySoundView display];
- [ScrollView2 display];
-
- [NXApp stopModal];
- return aSound;
- }
-
- I have tied the above [display] both individually and in different
- combinatins.
-
- Any help would be apprectiated.
-
- Thanks much in advance.
-
-
- Bill
-