In my last post I talked about the hack I did to get some Java applets running in an OpenOffice.org docking window.
I played a little more with the code and managed to get a XEMBED socket running in an OpenOffice.org docking window. The picture below shows an OpenOffice.org running with a XEMBED ready docking window:
The title bar of the docking window shows the socket id to which XEMBED applications can connect.
I used the following Mono code to connect to the XEMBED socket:
using System;
using Gtk;
// Compile with:
// mcs -pkg:gtk-sharp SamplePlug.cs
public class SamplePlug
{
public static void Main(string[] args) {
if (args.Length != 1) {
Console.WriteLine("Need socket id as an argument.");
return;
}
uint socket_id = UInt32.Parse(args[0]);
Console.WriteLine("using socket "+socket_id);
Application.Init();
Plug plug= new Plug(socket_id);
// plug.Add(new Label("HELLO"));
plug.Add(new Entry("HELLO"));
plug.ShowAll();
Console.WriteLine("running..");
Application.Run();
}
}
The picture below shows it all running:
In theory this'll work not only with Mono but with any application which can talk the XEMBED protocol like e.g. GTK- and QT-based applications.