[comp.windows.x] Finding the parent of a widget

soh@shiva.trl.oz (kam hung soh) (08/07/90)

Dear Netters,

	This sounds stupid, but I suddenly realise I don't know how to
find the parent of a Xt widget!  I know there is a field in the core
widget which contains the parent, but I don't know how to get it
nicely.  Could some kind soul point out how to do it, and where I can
find further information?  Please email, and I'll summarise.

Thanks

---
Soh, Kam Hung      email: h.soh@trl.oz.au     tel: +61 03 541 6403 
Telecom Research Laboratories, P.O. Box 249, Clayton, Victoria 3168, Australia 

don@zardoz.coral.COM (Don Dewar) (08/08/90)

) Return-Path: <uunet!expo.lcs.mit.edu!xpert-mailer>
) Date: 7 Aug 90 03:36:55 GMT
) From: uunet!bloom-beacon.mit.edu!unmvax!uokmax!munnari.oz.au!bruce!trlluna!shiva!soh  (kam hung soh)
) Subject: Finding the parent of a widget
) Sender: uunet!expo.lcs.mit.edu!xpert-request
) To: xpert@expo.lcs.mit.edu
) 
) 
) Dear Netters,
) 
) 	This sounds stupid, but I suddenly realise I don't know how to
) find the parent of a Xt widget!  I know there is a field in the core
) widget which contains the parent, but I don't know how to get it
) nicely.  Could some kind soul point out how to do it, and where I can
) find further information?  Please email, and I'll summarise.
) 
) Thanks
) 
) ---
) Soh, Kam Hung      email: h.soh@trl.oz.au     tel: +61 03 541 6403 
) Telecom Research Laboratories, P.O. Box 249, Clayton, Victoria 3168, Australia 
) 
) 


There is a macro in the XmP.h (private functions/methods) called
XtParent.  I see no reason why this has been made private, but it
works.  Since I would like to know if there is a reason this call is
private, I thought I would *beam* my respose out to the net.

  +---------+
  | Coral   |
  |@@@@@*@**|
  |@@*@@**@@|     Don Dewar
  |*@@**@@@@|     Coral Network Corporation, Marlborough, MA
  |@***@@@@@|     Internet: don@coral.com
  |@@**@@@@@|     Phone:    (508) 460-6010
  |*********|     Fax:      (508) 481-6258
  |Networks |
  +---------+

swick@ATHENA.MIT.EDU (Ralph Swick) (08/08/90)

    There is a macro in the XmP.h (private functions/methods) called
    XtParent.  I see no reason why this has been made private, but it
    works.

In R4, XtParent() is also a public function, declared in Intrinsic.h.
The macro is still declared in IntrinsicP.h for efficiency.

mayer@hplabsz.HPL.HP.COM (Niels Mayer) (08/09/90)

In article <9008071759.AA23290@zardoz.coral.com> don@zardoz.coral.COM (Don Dewar) writes:
>There is a macro in the XmP.h (private functions/methods) called
>XtParent. 

You don't need XmP.h ... It is available in Motif 1.0 in
<X11/Intrinsics.h>, and in X11r4 in <X11/Intrinsics.h>

Here is the def from X11r4 Intrinsics.h (Motif copyright nazis take note
that I'm not posting the Motif version!):

> extern Widget XtParent(
> #if NeedFunctionPrototypes
>     Widget 		/* widget */
> #endif
> );

-------------------------------------------------------------------------------
	    Niels Mayer -- hplabs!mayer -- mayer@hplabs.hp.com
		  Human-Computer Interaction Department
		       Hewlett-Packard Laboratories
			      Palo Alto, CA.
				   *