home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / windows / openloo / 3522 < prev    next >
Encoding:
Text File  |  1992-08-20  |  1.3 KB  |  50 lines

  1. Newsgroups: comp.windows.open-look
  2. Path: sparky!uunet!usc!sdd.hp.com!nigel.msen.com!heifetz!agog!greg
  3. From: greg@agog (Greg Cockroft)
  4. Subject: Re: Question on XView  scrolling list display
  5. Message-ID: <1992Aug20.151701.6345@agog.com>
  6. Sender: greg@agog.com (Greg Cockroft)
  7. Organization: Agog, Inc.
  8. References: <1992Aug19.213824.5646@agog.com>
  9. Date: Thu, 20 Aug 1992 15:17:01 GMT
  10. Lines: 38
  11.  
  12. In article <1992Aug19.213824.5646@agog.com> greg@agog (Greg Cockroft)  
  13. writes:
  14. > Is there anyway to control where a scroll list is scrolled to under  
  15. XView?
  16.  
  17. Someone pointed me to the scrollbar chapter in O'Reilly.
  18. Here is what I came up with if anyone else is interested. 
  19.  
  20. /*
  21.  * Make sure this row is visible in a scroll list.
  22.  */
  23. void makerowvisible(list, row)
  24. Xv_opaque   list;
  25. int         row;
  26. {
  27. Xv_opaque   sb;
  28. int         view_start;
  29. int         view_length;
  30.  
  31.     sb = xv_get(list, PANEL_LIST_SCROLLBAR);
  32.     view_start = xv_get(sb,SCROLLBAR_VIEW_START);
  33.     view_length = xv_get(sb,SCROLLBAR_VIEW_LENGTH);
  34.  
  35.     if(row < view_start || row >= (view_start + view_length)) {
  36.         xv_set(sb,SCROLLBAR_VIEW_START,row,NULL);
  37.     }
  38. }
  39.  
  40.     -greg.
  41.  
  42.  
  43. -- 
  44. Greg Cockroft                       greg@agog.com    
  45. Agog, Inc.                          (517) 627-2186   fax 2673
  46. 13780 North River Highway
  47. Grand Ledge, MI  48837
  48.