如何使用 Python/Glade 更改主窗口小部件? [英] How to change the main window widgets with Python/Glade?

查看:20
本文介绍了如何使用 Python/Glade 更改主窗口小部件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我或多或少是 GUI 编程的新手(只是一些 Perl/Tk 经验);我是 Python 新手,我也是 Glade 新手,我都想学习如何使用.

I am more or less new to GUI programming (just some tiny bit of Perl/Tk experience); I am new to Python, and I am new to Glade, both of which I would like to learn how to use.

我有一个程序需要一个窗口,但是这个窗口的内容(小部件和所有)必须随着用户完成的每一步而改变(就像在 Windows/Mac 的安装程序之一中继续单击下一步").问题是,现在(在无代码阶段)我已经为如何解决这个问题而苦恼了.我试过谷歌搜索,但我似乎不知道正确的关键字.如果这里有人可以帮助我提供涵盖下一步"的教程的链接,或者至少提供一两个有用的关键字,那就太好了.

I have a program in mind which would require one single window, but this window's contents (widgets and all) would have to change with each step that the user has completed (like in one of the installers for Windows/Mac where you keep clicking "Next"). The trouble is that already now (at the no-code-stage) I am stumped for how to tackle this. I have tried googling, but I don't seem to even know the right keywords. It would be great if someone on here could help me out with a link to a tutorial covering that "Next-thing" or at least with one or two helpful keywords.

非常感谢!

推荐答案

Glade 允许您创建部分窗口.例子:你可以用你想要的内容创建许多GtkVBox,然后在它们之间进行运行时交换.

Glade allows you to create partial windows. Example: You can create many GtkVBox'es with the contents you want, and then in runtime swap between them.

事实上,glade 已经包含了 GtkAssistant, 一个用来引导用户完成多步操作的小部件.它包括一些工具来简化实现next-next-finish"风格的对话框.每一步通常由一个助手页面处理.助手控制页面流程以收集完成应用任务所需的数据."

In fact, glade already includes GtkAssistant, "a widget used to guide users through multi-step operations. It includes tools to ease implementing the "next-next-finish" style of dialogs. Each step is generally handled by one assistant page. The assistant controls the page flow to collect the necessary data to complete the application task."

尝试使用它,并告诉我们它是如何进行的,如果您有问题,最好提出另一个更具体的问题.

Try to use it, and tell us how it goes, preferably by asking another, more specific question, if you have problem.

这篇关于如何使用 Python/Glade 更改主窗口小部件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆