在 PyGtk GUI 中嵌入交互式 shell (VTE) 以操作其自己的小部件
我计划执行以下操作:
使用一些小部件创建一个 PyGtk GUI(硬编码,无 Glade),并在屏幕底部放置某种 VTE(虚拟终端模拟器),我可以在其中操作小部件,例如更改它们的属性并从命令行调用它们的方法。
结果与使用 AutoCAD 的命令类似,只是我将对 GUI 对象进行操作。
我已经发现了一些关于 gtk.VteTerminal 小部件的东西,但不仅找不到工作示例或自己制作一个,它似乎也是一个系统终端,而不是“当前会话”python我可以在终端中运行 python 命令并访问 GUI 对象。
有什么建议吗?
感谢您的阅读
I am planning to do the folliwing:
Create a PyGtk GUI (hardcoded, no Glade) with some widgets, and at the bottom of the screen put some sort of VTE (Virtual Terminal Emulator) from where I could manipulate the widgets, for example changing their attributes and calling their methods from the commandline.
The result would be similar to using AutoCAD's commands, only that I would be acting upon the GUI objects.
I have already found very few things about gtk.VteTerminal
widget, but not only could not find a working example or make one myself, it also seem to be a system terminal, not a "current session" python terminal where I could run python commands and access GUI objects.
Any suggestion?
Thanks for reading
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你想要的已经存在:GtkParasite。它用于调试,但我确信如果您希望它实际上成为应用程序的一部分,您可以对其进行调整。
What you want exists already: GtkParasite. It's meant for debugging, but I'm sure if you wanted it to actually be a part of your application, you could adapt it.
我参加聚会迟到了,但我也遇到了类似的问题。
看这里
虚拟终端问题
这是一个选项,如果您决定做一些与你可能已经做过的事情不同的事情。
I'm late to the party, but I had a similar problem.
Look here
Virtual Terminal Question
It's an option if you decide to do something different than what you might have already done.