在 wxPython 中,使应用程序比向导稍微复杂的标准过程是什么? [英] In wxPython, What is the Standard Process of Making an Application Slightly More Complex Than a Wizard?

查看:21
本文介绍了在 wxPython 中,使应用程序比向导稍微复杂的标准过程是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 wxPython 创建我的第一个操作系统级 GUI.我有这本书 wxPython in Action 并且看过代码演示.我没有事件驱动编程(除了一些 Javascript)、sizer 和所有典型的 GUI 元素的经验.这本书的组织有点奇怪,并且假设我对 OS GUI 编程的了解比我实际了解的多得多.我也是最近才开始接触面向对象编程的.我知道我显然超出了我的深度.

I am attempting to create my first OS-level GUI using wxPython. I have the book wxPython in Action and have looked at the code demos. I have no experience with event-driven programming (aside from some Javascript), sizers, and all of the typical GUI elements. The book is organized a little strangely and assumes I know far more about OS GUI programming than I actually do. I'm fairly recent to object-oriented programming, as well. I'm aware that I am clearly out of my depth.

我的应用程序,在 GUI 方面,很简单:主要是一组提醒屏幕(打开扫描仪"、打开打印机"等)和 Python 中的后台操作,无论是在文件系统中还是点击web 服务,但它足够复杂,Wizard 类似乎并没有完全涵盖它.我必须更改返回"和下一步"按钮上的名称,有时禁用它们,等等.

My application, on the GUI side, is simple: mostly a set of reminder screens ("Turn on the scanner," "Turn on the printer," etc) and background actions in Python either in the filesystem or from hitting a web service, but it is just complex enough that the Wizard class does not quite seem to cover it. I have to change the names on the "Back" and "Next" buttons, disable them at times, and so forth.

像我这样的应用程序的标准流程是什么?

What is the standard process for an application such as mine?

1) 创建一个 wxFrame,然后将我所有的 wxPanels 放入其中,隐藏除一个之外的所有面板,然后在触发下一步"按钮(或当前等效按钮)时执行一系列隐藏和显示?

1) Create a single wxFrame, then put all of my wxPanels inside of it, hiding all but one, then performing a sequence of hides and shows as the "Next" button (or the current equivalent) are triggered?

2) 创建多个 wxFrames,每个 wxPanel,然后在它们之间切换?

2) Create multiple wxFrames, with one wxPanel in each, then switch between them?

3) 在 wxWizard 中更改按钮名称并禁用它们的一些不明显的方式?

3) Some non-obvious fashion of changing the names of the buttons in wxWizard and disabling them?

4) 在上述三个类别中我没有预料到的东西.

4) Something I have not anticipated in the three categories above.

推荐答案

我不太了解你的应用程序,但试图强制 wxWizard 满足你的需求听起来是个坏主意.

I don't have a good understanding of your application, but trying to force wxWizard to suit your needs sounds like a bad idea.

我建议查看 wxPython 网站上提供的演示.浏览每个演示,我敢打赌您会找到适合您需求的演示.

I suggest checking out the Demos available from the wxPython website. Go through each demo and I bet you'll find one that suits your needs.

我个人从未使用过 wxWizard,因为我觉得它太麻烦了.相反,我创建了一系列满足我需要的对话框.

I've personally never used wxWizard as I find it too cumbersome. Instead, I create a sequence of dialogs that do what I need.

这篇关于在 wxPython 中,使应用程序比向导稍微复杂的标准过程是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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