From: Jeff E. <je...@un...> - 2006-04-11 12:31:30
|
The "frame" widget has this option (from the tk manpage): Command-Line Name:-container Database Name: container Database Class: Container The value must be a boolean. If true, it means that this w= indow will be used as a container in which some other application= will be embedded (for example, a Tk toplevel can be embedded = using the -use option). The window will support the appropriate= win=E2=80=90 dow manager protocols for things like geometry requests. = The window should not have any children of its own in this app= lica=E2=80=90 tion. This option may not be changed with the configure w= idget command. However, actually using this option seems to lead to focus-related headac= hes. Anyhow, here's a program that embeds an ImageMagick "display" into a Tk f= rame: #----------------------------------------------------------------------- import Tkinter, sys, os t =3D Tkinter.Tk() b =3D Tkinter.Button(text=3D"quit", command=3Dt.destroy) f =3D Tkinter.Frame(container=3DTrue, width=3D300, height=3D300, bg=3D"") f.pack(side=3D"top") b.pack(side=3D"top") os.spawnvp(os.P_NOWAIT, 'display', ['display', '-window', hex(f.winfo_id()), '-window_group', hex(f.winfo_id()), sys.argv[1]]) t.mainloop() #----------------------------------------------------------------------- Jeff |