How to change the main window widgets with Python/Glade?

旧城冷巷雨未停 提交于 2019-12-11 00:49:56

问题


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.

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.

Thanks a lot in advance!


回答1:


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.

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.



来源:https://stackoverflow.com/questions/4361364/how-to-change-the-main-window-widgets-with-python-glade

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!