home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / next / programm / 5586 < prev    next >
Encoding:
Text File  |  1992-08-12  |  2.7 KB  |  89 lines

  1. Newsgroups: comp.sys.next.programmer
  2. Path: sparky!uunet!munnari.oz.au!bruce.cs.monash.edu.au!monu6!ede978e
  3. From: ede978e@monu6.cc.monash.edu.au (Robert D. Nicholson)
  4. Subject: NXBrowser problem
  5. Message-ID: <1992Aug13.015731.12978@monu6.cc.monash.edu.au>
  6. Summary: Help with NXBrowser Problem
  7. Organization: Monash University, Caulfield Campus
  8. Date: Thu, 13 Aug 1992 01:57:31 GMT
  9. Lines: 78
  10.  
  11.  
  12. Strange, 
  13.  
  14. As I explained I have this set up.
  15.  
  16. A list of employees and a list of rooms.
  17.  
  18. Say I create 3 rooms and each room appears at a branch in column 0
  19. then I create 3 employees each in different rooms. As mentiond 
  20. employees are leafs in column 1 hanging off a room branch.
  21.  
  22. The first employee I add gets loaded correctly and there in after
  23. all other employees appear as "BrowserItem" off their corresponding
  24. room branch.
  25.  
  26. Signed confused.
  27.  
  28. Another thing, I cannot accept the exception error im getting since
  29. I have two multicolumn browser examples and they don't give me this
  30. error.  Everytime I click on a branch I get an exception error.
  31.  
  32. Aug 13 11:36:42 steffi Romper[1788]: Exception handlers were not properly removed.
  33.  
  34. My browser fill method looks like this.
  35.  
  36. Code follows.
  37.  
  38. - (int)browser:sender fillMatrix:matrix inColumn:(int)column
  39. {
  40.     int row;
  41.     int count = 0;
  42.     NXBrowserCell *cell;    
  43.     String *roomDescription; 
  44.     List *employeesList;
  45.     List *roomsList;
  46.     
  47.     employeesList = [[NXApp currentDocument] employeesList];
  48.     roomsList = [[NXApp currentDocument] roomsList];
  49.  
  50.     if (column == 0) {        
  51.         count = [roomsList count];    
  52.         for (row = 0; row < count; row++) {
  53.             [matrix addRow];
  54.             cell = [matrix cellAt:row :0];
  55.             roomDescription = [[roomsList objectAt: row] roomDescription];
  56.             [cell setStringValue:[roomDescription str]];      
  57.             [cell setLeaf:NO];
  58.             [cell setLoaded:YES];
  59.         }
  60.         return count;
  61.     }
  62.     else {
  63.         String *employeesRoom;
  64.         int empCount = [employeesList count];
  65.         const char *roomDescription;
  66.         Employee *anEmployee;
  67.                 
  68.         roomDescription = [[[sender matrixInColumn:column-1] selectedCell] stringValue];
  69.         for (row = 0; row < empCount; row++) {
  70.             anEmployee = [employeesList objectAt:row];
  71.             employeesRoom = [anEmployee employeeRoom];
  72.             if (![employeesRoom compareSTR:roomDescription]) {
  73.                 [matrix addRow];
  74.                 cell = [matrix cellAt:row :0];
  75.                 [cell setStringValue:[[anEmployee employeeName] str]];
  76.                 [cell setLeaf:YES];
  77.                 [cell setLoaded:YES];
  78.                 count++;
  79.             }
  80.         }
  81.         return count;
  82.     }
  83.  
  84.     return 0;
  85. }
  86.  
  87. Any ideas?
  88.  
  89.