etxmwe@solsta.ericsson.se (Martin Wennberg TX/DKF) (02/13/91)
I have a problem in XView to get the handle to a splitted Scrollbar, which is attached to a Canvas. The Canvas is splitted once, horizontal, with a vertical Scrollbar to each view. I've succeeded to get the handle to the view 0 scrollbar with: xv_get(canvas, OPENWIN_VERTICAL_SCROLLBAR, 0) or xv_get(canvas, OPENWIN_NTH_VIEW, 0) xv_get(canvas, OPENWIN_VERTICAL_SCROLLBAR) But it is impossible to get in touch with the second Scrollbar. All help are very much appreciated, thanks!! Martin Wennberg
rick@pbi.COM (Richard M. Goldstein) (02/14/91)
xv_get(canvas, OPENWIN_NTH_VIEW, 0) xv_get(canvas, OPENWIN_VERTICAL_SCROLLBAR) But it is impossible to get in touch with the second Scrollbar. have you tried getting the OPENWIN_VERTICAL_SCROLLBAR on the nth view (not the 0th view)? try this: /* * get scrollbar attached to first view */ view = (Xv_Window)xv_get ( canvas, OPENWIN_NTH_VIEW, 1 ); scrollbar = (Scrollbar)xv_get ( canvas, OPENWIN_VERTICAL_SCROLLBAR ); to traverse a hierarchy of views, try: OPENWIN_EACH_VIEW(canvas, view) scrollbar = xv_get( view, OPENWIN_VERTICAL_SCROLLBAR ); /* do whatever with scrollbar */ OPENWIN_END_EACH hope this helps. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % Richard M. Goldstein % % % % Perfect Byte, Inc. Phone: (402)554-1122 % % 7121 Cass St. Fax: (402)554-1938 % % Omaha, NE 68132 email: rick@pbi.com % % % % "If I knew what I was doing, % % d'ya think I'd be in Omaha?" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
dmaustin@vivid.sun.com (Darren Austin) (02/14/91)
In article <9102132013.AA07452@marvin.pbi.com> rick@pbi.COM (Richard M. Goldstein) writes: [quoting someone else's question] > > xv_get(canvas, OPENWIN_NTH_VIEW, 0) > > xv_get(canvas, OPENWIN_VERTICAL_SCROLLBAR) > > > > But it is impossible to get in touch with the second Scrollbar. > > have you tried getting the OPENWIN_VERTICAL_SCROLLBAR on the nth view > (not the 0th view)? try this: > > /* > * get scrollbar attached to first view > */ > view = (Xv_Window)xv_get ( canvas, OPENWIN_NTH_VIEW, 1 ); > scrollbar = (Scrollbar)xv_get ( canvas, OPENWIN_VERTICAL_SCROLLBAR ); Close, bug no cigar ;-). This should read: view = (Xv_Window)xv_get ( canvas, OPENWIN_NTH_VIEW, 1 ); scrollbar = (Scrollbar)xv_get ( canvas, OPENWIN_VERTICAL_SCROLLBAR, view ); > to traverse a hierarchy of views, try: > > OPENWIN_EACH_VIEW(canvas, view) > scrollbar = xv_get( view, OPENWIN_VERTICAL_SCROLLBAR ); > /* do whatever with scrollbar */ > OPENWIN_END_EACH Close again, but... this should be: OPENWIN_EACH_VIEW(canvas, view) scrollbar = xv_get( canvas, OPENWIN_VERTICAL_SCROLLBAR, view ); /* do whatever with scrollbar */ OPENWIN_END_EACH Hope this helps clear up some confusion...clear as mud, right ;-)? Later, --Darren -- Darren Austin | Actually, it's a buck and a quarter Windows and Graphics Software | staff, but I'm not going to tell Sun Microsystems, Mountain View | *him* that. dmaustin@sun.com |