jane@Unify.Com (06/21/91)
Anybody out there likes to tell me what happen with the XVIEW SCROLLBAR
problem that I am running into ?
The question is after I created a scrollbar and installed a callback routine
in the scrollbar(with attribute SCROLLBAR_NORMALIZE_PROC). Inside of the
callback routine, I use xv_get(scrollbar_name, SCROLLBAR_VIEW_START) to
get the value of SCROLLBAR_VIEW_START(in the mean time, I scroll the
scrollbar), then I expect the SCROLLBAR_VIEW_START should not be 0
(because I am scrolling the bar), but I always get 0. Again, My
question is why I can't get SCROLLBAR_VIEW_START value correctly?
Is there any tricks involved in addition to the way I did ?
Is this a xview bug? are there any workaround ?
(My scrolled object is a pixmap not a text file)
scrollbar = (Scrollbar)xv_create(canvas, SCROLLBAR,
SCROLLBAR_DIRECTION, SCROLLBAR_VERTICAL,
SCROLLBAR_PIXELS_PER_UNIT, 14,
SCROLLBAR_OBJECT_LENGTH, 71,
SCROLLBAR_VIEW_LENGTH, 17,
SCROLLBAR_PAGE_LENGTH, 17,
SCROLLBAR_NORMALIZE_PROC, monitor_scroll,
NULL);
monitor_scroll()
{
int view_start, last_view_start;
/* why view_start and last_view_start are always 0 ?*/
view_start = (int) xv_get(scrollbar, SCROLLBAR_VIEW_START);
last_view_start = (int)xv_get(scrollbar,
SCROLLBAR_LAST_VIEW_START);
}
Thanks,
Jane Huang UUCP: uunet!natadm!jane
Network Application Technology
harling@pictel.uucp (Dan Harling) (06/25/91)
In article <jzhs7t5@openlook.Unify.Com> <uunet!uunet!natadm!jane@Unify.Com> Jane Huang writes: > >Anybody out there likes to tell me what happen with the XVIEW SCROLLBAR >problem that I am running into ? > > scrollbar = (Scrollbar)xv_create(canvas, SCROLLBAR, > SCROLLBAR_DIRECTION, SCROLLBAR_VERTICAL, > SCROLLBAR_PIXELS_PER_UNIT, 14, > SCROLLBAR_OBJECT_LENGTH, 71, > SCROLLBAR_VIEW_LENGTH, 17, > SCROLLBAR_PAGE_LENGTH, 17, > SCROLLBAR_NORMALIZE_PROC, monitor_scroll, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > NULL); > >monitor_scroll() >{ > int view_start, last_view_start; > > /* why view_start and last_view_start are always 0 ?*/ > view_start = (int) xv_get(scrollbar, SCROLLBAR_VIEW_START); > last_view_start = (int)xv_get(scrollbar, > SCROLLBAR_LAST_VIEW_START); >} What parameters and return value are the NORMALIZE_PROC supposed to accept and return? I know (by experimentation) that the first parameter is a handle to the scrollbar. The XView manual mentions the SCROLLBAR_NORMALIZE_PROC argument at the end of the chapter on scrollbars, but it is not documented anywhere else. >Jane Huang UUCP: uunet!natadm!jane ______________________________________________________________________ Daniel A. Harling PictureTel, Inc. Rockport, MA Peabody, MA Opinions expressed herein are not necessarily those of PictureTel, Inc.; they are MINE, ALL MINE! (So there.) ---- === ====