[comp.windows.x] reparenting a gadget

gerday@shell.COM (12/18/90)

I'm forwarding this for a friend, please reply to me (or post if your
answer is of general interest). 

------- Forwarded Message

I am writing an OSF/Motif constraint widget (subclassed from XmManager)
that has three separate scrollable areas (the constraints determine
where to put the children). I have created three work areas under the
constraint widget that will be used to display the application added
children.  I use the XReparentWindow function to redirect the output of
the children to one of the three work areas.  This works correctly for
widgets.  However; I have a problem with OSF/Motif gadgets.  I was
hoping the gadgets had a field in its instance structure that contains
the window ID and I would be able to change this field.  This guess was
incorrect.  I am trying to implement behavior similar to the X11R3
Athena viewport widget (the children of the viewport widget are window
reparented to the clip window).  How does the X11R4 Athena viewport
widget handle window reparenting gadgets?

I do not want to reparent the widget/gadget instance tree.  Does anyone
have any suggestions on how I can reparent the window ID of a gadget?

------- End of Forwarded Message

Jan Gerday	    << C'etait chouette... on a bien rigole! >>
gerday@shell.com   			- Petit Nicolas

..!{sun,psuvax1,bcm,rice,decwrl,cs.utexas.edu}!shell!gerday
Consultant to:
Shell Oil Company, IC-6G05
P.O. Box 20329,  Houston, TX 77225-0320
	(Tel: 713.795.3075)

marbru@attc.UUCP (Martin Brunecky) (12/19/90)

In article <9012172352.AA01982@palm.ic.shell.com> gerday@shell.COM writes:
>
>I am writing an OSF/Motif constraint widget (subclassed from XmManager)
>that has three separate scrollable areas (the constraints determine
>where to put the children). I have created three work areas under the
>constraint widget that will be used to display the application added
>children.  I use the XReparentWindow function to redirect the output of
>the children to one of the three work areas.  This works correctly for
>widgets.  However; I have a problem with OSF/Motif gadgets.  I was
>hoping the gadgets had a field in its instance structure that contains
>the window ID and I would be able to change this field.  This guess was
>incorrect.  I am trying to implement behavior similar to the X11R3
>Athena viewport widget (the children of the viewport widget are window
>reparented to the clip window).  How does the X11R4 Athena viewport
>widget handle window reparenting gadgets?
>
>I do not want to reparent the widget/gadget instance tree.  Does anyone
>have any suggestions on how I can reparent the window ID of a gadget?

    Why not use a manager widget that controlls THREE XmScrolledWindows,
    each representing one of the work areas ?

    You may use either automatic scrolling, or tie all three areas
    to a single scrollbar using explicit scroll control.
    Note that XmScrolledWindow deals with (a single) gadget - at least the code
    is in there, I haven't tried that. 

    Of course you may create your own manager widget that will create
    and manage all three areas (including scrollbar creation and
    armament). This will also keep under control problems with XmScrolled...
    geometry management (query geometry method pecularities).

    Note some guidance code how to do this can be found in the XmText
    widget (XmCreateScrolledText) - I used it as an example to put
    Motif scrollbars into my WsText widget subclasses.


-- 
=*= Opinions presented here are solely of my own and not those of Auto-trol =*=
Martin Brunecky                           {...}sunpeaks!auto-trol!marbru
(303) 252-2499                        (sometimes also:  marbru@auto-trol.COM )
Auto-trol Technology Corp. 12500 North Washington St., Denver, CO 80241-2404 

ben@hpcvlx.cv.hp.com (Benjamin Ellsworth) (12/19/90)

Gadgets are window-less objects.  They draw in their parent's window.