home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.windows.open-look
- Path: sparky!uunet!usc!sdd.hp.com!nigel.msen.com!heifetz!agog!greg
- From: greg@agog (Greg Cockroft)
- Subject: Re: Question on XView scrolling list display
- Message-ID: <1992Aug20.151701.6345@agog.com>
- Sender: greg@agog.com (Greg Cockroft)
- Organization: Agog, Inc.
- References: <1992Aug19.213824.5646@agog.com>
- Date: Thu, 20 Aug 1992 15:17:01 GMT
- Lines: 38
-
- In article <1992Aug19.213824.5646@agog.com> greg@agog (Greg Cockroft)
- writes:
- >
- > Is there anyway to control where a scroll list is scrolled to under
- XView?
- >
-
- Someone pointed me to the scrollbar chapter in O'Reilly.
- Here is what I came up with if anyone else is interested.
-
- /*
- * Make sure this row is visible in a scroll list.
- */
- void makerowvisible(list, row)
- Xv_opaque list;
- int row;
- {
- Xv_opaque sb;
- int view_start;
- int view_length;
-
- sb = xv_get(list, PANEL_LIST_SCROLLBAR);
- view_start = xv_get(sb,SCROLLBAR_VIEW_START);
- view_length = xv_get(sb,SCROLLBAR_VIEW_LENGTH);
-
- if(row < view_start || row >= (view_start + view_length)) {
- xv_set(sb,SCROLLBAR_VIEW_START,row,NULL);
- }
- }
-
- -greg.
-
-
- --
- Greg Cockroft greg@agog.com
- Agog, Inc. (517) 627-2186 fax 2673
- 13780 North River Highway
- Grand Ledge, MI 48837
-