2011-07-21 4 views
0

私は「シンプルな」プログラムを作りようとしています。開いているすべてのプログラムをリストして、それをあなたのウィンドウの中に開きます(あなたが言うかもしれないサムネイルのようですが、 。GTK、XLibなどを使って別のプログラムを埋め込む方法は?

1つのこと、片方だけでなければなりません(私は埋め込まれたプログラムを変更することはできず、例えば "ソケット"または "プラグ"を追加することはできません)。任意のプログラム(例:Opera、evince、JDownloaderなど)を組み込むことができるようにしたい。

どうすればいいですか?

GTKを使用して実行できない場合は、Xなどを使用できますか?どうやって?

答えて

1

あなたはXEmbedのようなものを探しているようです。 pythonとgtkのチュートリアルはhttp://www.moeraki.com/pygtktutorial/pygtk2tutorial/sec-PlugsAndSockets.html

+0

ありがとうございました、後でもう一度見ていただきます。 – Rodro

+0

私はこれが私を助けてくれるとは思わない、どんなプログラムでもこれをやりたいと思うし、ソケットを入れることができない。 – Rodro

+0

私は、種類のミニウィンドウマネージャーのように動作するプログラムを望んでいます。おそらく実行中のウィンドウマネージャーと通信する必要があります。実行中のWMに応じて、これは異なる方法で実行する必要があります。 – Dave

1

です。これはGtkPlugGtkSocketです。

+0

私はより明確にするために私の質問を変更しました。私はembededプログラムを変更することはできません、私は他のプログラム(オペラ、evinceなど)を埋め込むプログラムを作りたいです。 – Rodro

0
using System;using Gtk;using System.Runtime.InteropServices;  public partial class MainWindow : Gtk.Window{ 



public MainWindow() : base(Gtk.WindowType.Toplevel) 
{ 
    Gtk.Socket socket; 
    int xid; 
    Fixed fixed2=new Fixed(); 
    this.socket = new Socket(); 
    this.socket.WidthRequest = 500; 
    this.socket.HeightRequest = 500; 
    this.socket.Visible = true; 
    this.socket.Realized += new EventHandler(OnVideoWidgetRealized); 

    fixed2.Put(socket, 0, 0); 
    fixed2.SetSizeRequest(500,500); 
    this.Add(fixed2); 
    this.ShowAll(); 

    OnButton17Clicked(); 

} 

protected virtual void OnVideoWidgetRealized (object sender, EventArgs 
               args) 
{ 
    this.xid = (int)socket.Id; 
    Console.WriteLine("this.xid:"+this.xid); 
} 

protected void OnDeleteEvent (object sender, DeleteEventArgs a) 
{ 
    Application.Quit(); 
    a.RetVal = true; 
    this.socket = new Socket(); 
} 

protected void OnButton17Clicked() 
{ 
    var paramString = string.Format("-wid {0} 1.avi", xid); 
    System.Diagnostics.Process proc = new System.Diagnostics.Process(); 
    proc.StartInfo.FileName = "mplayer.exe"; 
    proc.StartInfo.Arguments = paramString; 
    proc.Start(); 
    proc.WaitForExit(); 

} 
public static void Main() 
{ 
    Application.Init(); 
    new MainWindow(); 
    Application.Run(); 
}} 
関連する問題