[prev in list] [next in list] [prev in thread] [next in thread] 

List:       hpux-devtools
Subject:    Re: HPUX-DEVTOOLS: Plugin-Container programming with X11/Motif
From:       Mike Stroyan <stroyan () hpstryn ! fc ! hp ! com>
Date:       2003-02-25 21:25:54
[Download RAW message or body]

On Mon, Feb 24, 2003 at 10:28:33AM -0800, Srikanth Sankaran wrote:
>     Sorry about the off-topic post, could use some help from this list.
> 
>     I have two X windows program A and B which perform related but vastly
> different specialized tasks. From a UI standpoint, it would be ideal if 
> these appear as a single program to the user. So I would like to be able
> to treat A as the container into which B plugs in (somewhat like Adobe
> Acrobat reader plugging into Netscape.)
> 
>     The user should be able to switch between A and B at will, say by the
> push of a button. Is this possible to do with X11/Motif ? If it is relevant,
> A is a Motif program and B uses only X11 and Xext.
> 
>     From a practical standpoint, it is not feasible to merge them into one
> program due to complexity of each.
> 
>     References to API, documentation, sample code would be greatly
> appreciated.

  It should be fairly easy to embed your X11 application B into your
motif application A.  All you need to do is to create a motif widget in
B that will be the parent A.  Then pass the XtWindow(widget) of that
widget to the application B.  Application B would then use that window
ID instead of the root window.  You need to wait until a widget is
realized before you can use XtWindow on it.  Before it is realized the
window will just be None.  You may need to call XSync before giving the
window ID to application B.  A client makes up a window ID, but the X
server doesn't really learn about the window ID until the the
XCreateWindow request is received and processed.

  You can communicate the window ID with an exec argument or environment
variable, or root window property, or file, or any of a dozen ways.

  The motif program can toggle application B between visible and
non-visible by using XtManageChild and XtUnmanageChild on its 'parent'
widget.

  Things would be harder if you wanted to embed a motif program inside
another.  Motif shell widgets don't normally allow you to specify an
arbitrary parent window.  That is usually done with a custom shell
widget.  There is a paper on that here-
    http://jan.netcomp.monash.edu.au/SW.html#embed

-- 
Mike Stroyan, mike_stroyan@hp.com
 _________________________________________________________________
 To leave this mailing list, send mail to majordomo@cxx.cup.hp.com
    with the message UNSUBSCRIBE hpux-devtools
 _________________________________________________________________
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic