How to embed some kind of application window into my application using any Python GUI infrastructure

I want some application to look like a widget inside my Python application.

It's all. I do not need any interaction between them. I'm interested in solutions in any GUI for windows and windows windows.

It would be nice to have a solution with Tkinter, but that doesn't matter.

+5
source share
2 answers

GTK X- (, Linux, FreeBSD, Solaris), XEMBED- gtk.Socket. , , , , . . , Firefox.

, , X-, Emacs GTK:

import os
import gtk
from gtk import Socket, Button, Window, VBox, HBox

w = Window()
e = Button("Emacs")
x = Button("XTerm")
s = Socket()
v = VBox()
h = HBox()
w.add(v)
v.add(s)
h.add(e)
h.add(x)
v.pack_start(h, expand=False)

def runemacs(btn):
    x.set_sensitive(False); e.set_sensitive(False)
    os.spawnlp(os.P_NOWAIT, "emacs", 
        "emacs", "--parent-id", str(s.get_id()))

def runxterm(btn):
    x.set_sensitive(False); e.set_sensitive(False)
    os.spawnlp(os.P_NOWAIT, "xterm",
        "xterm", "-into", str(s.get_id()))

e.connect('clicked', runemacs)
x.connect('clicked', runxterm)
w.show_all()
gtk.main()
+5

, Glyphs. xterm, ,

XTerm*allowSendEvents: True 

~/.Xresources. (, , , xrdb -load ~/.Xresources)

0

All Articles