Add a child window

This forum is read only. No new submissions are accepted.

Questions about motif? Contact us

5 posts / 0 new
Last post
Add a child window

Submitted by Anonymous on Wed, 04/02/2003 - 12:05.

I am new to motif and hopefully what I have been asked to do - can be done in Motif!!! I need to place a java window on a motif window.

Here is what I have

In my c++ code, I have the
1> Handle to the widget (lets call this nativeWindow) I need to add child windows to.
2> Display and Drawable handles to the java window.
Now, Can I get the parent widget (lets call this parentJavaWindow) for this java window (which is the window I need to place on a motif window)
3> If yes, now can I make nativeWindow the parent window of parentJavaWindow. Not that these already have been created. All the calls I have seen in motif are of the kind

XtVaCreateManagedWidget( name, class, parent, .... NULL )
or
XtManageChild( widget )

But, what I need is kind of
setNewParent(widgetChild, widgetParent)

I will appreciate any help on this.

Thanks in advance,
Jaidev

 

 

Wed, 04/02/2003 - 21:53#1

Anonymous

Add a child window

you cannot change child`s parent on the fly in Motif

but
you can get the parent window using wgt->core.parent

regards
ragu

  •  

 

Thu, 04/03/2003 - 01:21#2

Thu, 04/03/2003 - 01:21#2

ICS_support

Add a child window

The concept of setting a new parent is explicitly missing from Xt. You can reparent a window, however. This reparenting, at the Xlib level, is what window managers do when they put frames around application windows. It is also the basis for several Inset packages designed to let you do what you want to do -- use a window within the application for other applications. Check http//ftp.x.org for this code. (I`m under the impression, though, that none of it works too well.)

The best solution is to work the problem in reverse. That is, create a widget in your application such as an XmDrawingArea. Then get its XtWindow() after it is realized. Then have the Java application use that window as its base window. (This may be the hard part.) Both Xt and Java will be happy.

 

 

Thu, 04/03/2003 - 01:22#3

ICS_support

Add a child window

Well, that might be a help in traversing widget trees. But you shouldn`t be reaching into the widget`s structure. There are public functions for that. In this case, you use XtParent(). And it returns the widget, not the window, which you can then get with XtWindow().

 

Mon, 04/07/2003 - 22:31#4

Mon, 04/07/2003 - 22:31#4

Anonymous

Add a child window

Thanks a lot for the reply. Unfortunately, I am not sure if Java can handle window handles!!
But, anyways - I`ll check the site. But if possible can you give me a clue where to look at or what to look at (there are tons of things at this site)?

Thanks once again.
Jaidev