[comp.windows.x.motif] XmScrolledWindow

john@quonset.cfht.hawaii.edu (John Kerr) (08/16/90)

I have a scrolled window that is the parent of a draw area widget.  I
have chosen to make the scrollingPolicy AUTOMATIC and let my drawing
have that smooth scrolling effect.  The problem I am having currently,
is that I would like to be notified of a scroll event, as mentioned in
the reference manual, but I can't seem to retrieve the scrollbar
widgets' ID.  I tried to get the ID as follows:

    XtSetArg (myArgs[0], XmNhorizontalScrollBar, &wid);
    XtGetValues (XtParent(graphAreaWid), myArgs, 1);

When executed, the widget ID (wid) comes back 0.  Any ideas
or suggestions?  

Thanks,

jk



 ----------------------------------------------------------------------------
 John Kerr                      Canada-France-Hawaii Telescope Corp.
                                INTERNET: john@cfht.hawaii.edu 
                                BITNET:   john@uhcfht
 ----------------------------------------------------------------------------

tomt@maui.coral.com (Tom Tulinsky) (08/16/90)

) From: uunet!quonset.cfht.hawaii.edu!john (John Kerr)

) I have a scrolled window that is the parent of a draw area widget.  I
) have chosen to make the scrollingPolicy AUTOMATIC and let my drawing
) have that smooth scrolling effect.  The problem I am having currently,
) is that I would like to be notified of a scroll event, as mentioned in
) the reference manual, but I can't seem to retrieve the scrollbar
) widgets' ID.  I tried to get the ID as follows:
) 
)     XtSetArg (myArgs[0], XmNhorizontalScrollBar, &wid);
)     XtGetValues (XtParent(graphAreaWid), myArgs, 1);
) 
) When executed, the widget ID (wid) comes back 0.  Any ideas
) or suggestions?  

I think the widget (first) argument to XtGetValues is wrong.  Save the
actual value of the ScrolledWindow widget when it is created and use
it. There are various hidden widgets created in ScrolledWindow;
for instance there is a "clip window" child of the ScrolledWindow and parent
of the WorkArea (your graphArea).  

By the way, if you need to move the graphArea manually sometimes but
want to keep AUTOMATIC scrolling, see my message "XmScrolledWindow 
manual/automatic scrolling" today.


 Coral
     * **	Tom Tulinsky                508 460-6010
  *  **		Coral Network Corporation   fax 508 481-6258
*  ** 		734 Forest St               net: tomt@coral.com
 ***		   Marlboro, MA 01752		
  **		   U S A
*********	
NETWORKS	

stan@b17b.INGR.COM (Stan Hardy) (08/20/90)

In article <9030@uhccux.uhcc.Hawaii.Edu>, john@quonset.cfht.hawaii.edu (John Kerr) writes:
# I have a scrolled window that is the parent of a draw area widget.  I
# have chosen to make the scrollingPolicy AUTOMATIC and let my drawing
# have that smooth scrolling effect.  The problem I am having currently,
# is that I would like to be notified of a scroll event, as mentioned in
# the reference manual, but I can't seem to retrieve the scrollbar
# widgets' ID.  I tried to get the ID as follows:
# 
#     XtSetArg (myArgs[0], XmNhorizontalScrollBar, &wid);
#     XtGetValues (XtParent(graphAreaWid), myArgs, 1);
# 
# When executed, the widget ID (wid) comes back 0.  Any ideas
# or suggestions?  
# 

Use XtParent(XtParent(graphAreaWid)).  The parent of your drawing area is
actually the clip window of the scrolled window.  The clip window's parent
is the scrolled window, which contains the XmNhorizontalScrollBar resource.

# Thanks,
# 
# jk
# 
# 
# 
#  ----------------------------------------------------------------------------
#  John Kerr                      Canada-France-Hawaii Telescope Corp.
#                                 INTERNET: john@cfht.hawaii.edu 
#                                 BITNET:   john@uhcfht
#  ----------------------------------------------------------------------------
      _____________________________________________________________________
     /				       \				   /
    /   Stan Hardy 			\  Disclaimer:          	  /	
   /   Intergraph Corporation            \  This is only an exhibition,  /
  /   Phone : (205) 730-1346	          \  not a competion.  Please,  /  
 /   Mail  : ..!uunet!ingr!b17c!c120g!stan \  no wagering.  	       /
/___________________________________________\_________________________/