pygtk 如何在我的 pygtk GUI 中嵌入外部应用程序

发布于 2024-08-17 03:31:33 字数 61 浏览 3 评论 0原文

我正在设计一个 pygtk GUI 并希望将外部应用程序嵌入其中。

有谁知道如何做到这一点?

I'm desiging a pygtk GUI and want to embed an external application into it.

Does anyone have any idea how this can be done?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

花海 2024-08-24 03:31:33

这取决于您尝试嵌入到您的应用程序中的应用程序,但如果另一个应用程序是 GTK 应用程序(或支持 XEMBED 协议的应用程序),您应该能够使用 gtk.Pluggtk.Socket。 PyGTK 教程有一节解释了如何执行此操作:

PyGTK 2.0 教程 - 插头和插座 来自 Wayback Machine (archive.org)

It depends on what application you are trying to embed into yours, but if the other app is a GTK app (or one that supports the XEMBED protocol), you should be able to do this with gtk.Plug and gtk.Socket. The PyGTK tutorial has a section explaining how to do this:

PyGTK 2.0 Tutorial - Plugs and Sockets from Wayback Machine (archive.org)

顾忌 2024-08-24 03:31:33

您不需要使用外部程序来获取 gtk.Plug/gtk.Socket ID,它们有各自的功能。请参阅本教程以获取示例:

PyGTK 2.0 教程 - 插头和插座链接来自 Wayback Machine (archive.org)。

You don't use an external program to get the gtk.Plug/gtk.Socket ID, they have their respective functions for that. See this tutorial for examples:

PyGTK 2.0 Tutorial - Plugs and Sockets link from Wayback Machine (archive.org).

幼儿园老大 2024-08-24 03:31:33

如果您尝试重新设置外部窗口(可能不是 gtk 窗口)的父级,您可以使用

w = gdk.window_foreign_new(window_id)

从操作系统窗口句柄获取 gdk 窗口对象,然后使用

w.reparent(parent_window, x, y)

将其重新设置为现有 gtk 容器的父级。

If you're trying to reparent an external window (that may not be a gtk window), you can use

w = gdk.window_foreign_new(window_id)

to get a gdk window object from an operating system window handle, and then use

w.reparent(parent_window, x, y)

to reparent it into an existing gtk container.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文