Re: Embedding applications via XEmbed



On 2011-01-20 20:52, Michael Treibton wrote:
> I've read about GtkSocket and GtkPlug, but the examples for the
> official documentation don't make it clear to me how to go about this.
> 
> Can someone outline more fully how this would work?

Most likely you want to do something like this:

  1. Create a GtkSocket as part of your application
  2. Get the GtkSocket's window ID
  3. Pass the window ID to the application you want to embed

Gtk and the other application should take care of the rest. A common way
to pass the window id is with a flag when you spawn the other program.
For example `xterm -into <id>' or `mplayer -wid <id>'.


> If someone could provide an example of how this is handled, i'd much
> appreciate it.

I've attached a small example I wrote a while back that embeds a gVim
window inside an GTK+ application. You should be able to substitute any
other XEmbed application for gVim. You can just print out the window id
and the spawn the other application manually if you want.

Attachment: pgpIcbXR3Ei0R.pgp
Description: PGP signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]