home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / next / programm / 5606 < prev    next >
Encoding:
Internet Message Format  |  1992-08-14  |  2.2 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!wupost!bcm!aio!news
  2. From: bill@epnxt.jsc.nasa.gov
  3. Newsgroups: comp.sys.next.programmer
  4. Subject: Question about assigning a SoundView to a ScrollView
  5. Message-ID: <1992Aug14.145716.10438@aio.jsc.nasa.gov>
  6. Date: 14 Aug 1992 14:57:16 GMT
  7. Sender: news@aio.jsc.nasa.gov (USENET News System)
  8. Reply-To: bill@epnxt.jsc.nasa.gov
  9. Organization: nasa-jsc
  10. Lines: 73
  11.  
  12. The follow code is from a quick palette I put together in which I was  
  13. attempting to make a SoundView palette.  It seems to work fine execpt in  
  14. an actual application, I can not get the graphical portion of the sound  
  15. file to show up on the the ScrollView.
  16.  
  17.  
  18. from the palette:
  19.  
  20. -initFrame:(const NXRect *)frameRect
  21. {
  22.     NXRect tempRect = *frameRect;
  23.     int borderType = NX_NOBORDER;
  24.      
  25.     [super initFrame:frameRect];
  26.     [ScrollView getContentSize:&tempRect.size  
  27. forFrameSize:&frameRect->size
  28.             horizScroller:YES vertScroller:NO borderType:borderType];
  29.         
  30.     theSoundView = [[SoundView alloc] initFrame:&tempRect];
  31.     
  32.     [self setHorizScrollerRequired:YES];
  33.     [self setDynamicScrolling:YES];
  34.     [self setDocView:theSoundView];
  35.     
  36.     [self setBackgroundGray:NX_WHITE];
  37.     [self setBorderType:NX_BEZEL];
  38.     [self setAutoresizeSubviews:YES];
  39.     [self setAutosizing:NX_WIDTHSIZABLE|NX_HEIGHTSIZABLE];
  40.  
  41.     [[theSoundView superview] setAutoresizeSubviews:YES];
  42.     [theSoundView setAutosizing:NX_HEIGHTSIZABLE];
  43.  
  44.   //  [self setBackgroundColor:NX_COLORWHITE];
  45.     [self setBorderType:NX_BEZEL];
  46.     [self display];
  47.     return self;
  48. }
  49.  
  50.  
  51.  
  52. from my application:
  53.  
  54. - openFile:(char *)fileName
  55. {
  56.     id aSound;
  57.     
  58.     mySoundView = [ScrollView1 docView];
  59.     [mySoundView setSound:[[Sound alloc] init]];
  60.     aSound = [[Sound alloc] initFromSoundfile:fileName];
  61.     
  62.     [mySoundView setSound:aSound];
  63.     [mySoundView setDisplayMode:SK_DISPLAY_WAVE];
  64.     [ScrollView2 setDocView:mySoundView];
  65.     
  66.     [MyScrollWindow setTitleAsFilename:fileName];
  67.     [MyScrollWindow setMiniwindowIcon: "SoundIcon"];
  68.     
  69.     [mySoundView display];
  70.     [ScrollView2 display];
  71.  
  72.     [NXApp stopModal];
  73.    return aSound;
  74. }
  75.  
  76. I have tied the above [display] both individually and in different  
  77. combinatins.
  78.  
  79. Any help would be apprectiated.
  80.  
  81. Thanks much in advance.
  82.  
  83.  
  84. Bill
  85.