生成gui工具的解决方法 [英] workaround for generating gui tools

查看:83
本文介绍了生成gui工具的解决方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我主要通过wxGlade创建我的GUI。但是当你开始使用
程序并希望对gui进行一些重新排列时,wxglade会覆盖你的文件,并且你需要将自己的代码重新放入。


我想我可以通过制作第二个文件来解决这个问题(至少有一点)

导入wxglade生成的gui并使类成为扩展

原始的。

例如我可以有一个类MainForm,它扩展了wxFrame产生的wxFrame

类。


还有其他聪明的方法可以解决这个问题吗?


谢谢,

本尼迪克特

解决方案

本尼迪克特,


最好用手工编写代码;-) - 甚至GUI。这就是为什么我喜欢

Tkinter这么多。祝你好运。


Harlin Seritt


Harlin Seritt写道:

本尼迪克特,

最好手动编写代码;-) - 甚至是GUI。这就是为什么我非常喜欢Tkinter的原因。祝你好运。




强烈反对意见。


无论如何(对于更复杂的应用程序)来说它是邪恶的GUI构造
代码中的
。应该在数据文件中适当地描述GUI。


Glade做得非常好,使用pygtk使用XML文件没问题。


Reinhold


Reinhold Birkenfeld写道:

强烈反对意见。

它无论如何(对于更复杂的应用程序)将GUI构建放在代码中是邪恶的。应该在数据文件中适当地描述GUI。

Glade做得非常好,使用pygtk使用XML文件没问题。

Reinhold



因此GUI应该与代码分开。我描述的方式

有效吗?从gui类扩展并将事件处理程序放在

派生类中?

或者是否有更好的方法从代码中分离GUI?


Benedict


Hi,

i create my GUIs mainly via wxGlade. However when you start of to
program and want to do some rearranging to the gui, wxglade overwrites
your file and you''ve got to put your own code back in.

I think i can work around that (at least a bit) by making a second file
that imports the gui generated by wxglade and make classes that extend
the original ones.
For instance i could have a class MainForm that extends the wxFrame
class that wxGlade produces.

Are there other clever ways to work around this problem?

Thanks,
Benedict

解决方案

Benedict,

Best to hand-code your code ;-) -- even GUI. This is kind of why I like
Tkinter so much. Good luck.

Harlin Seritt


Harlin Seritt wrote:

Benedict,

Best to hand-code your code ;-) -- even GUI. This is kind of why I like
Tkinter so much. Good luck.



Have to disagree strongly.

It''s evil anyway (for more complex applications) to put GUI construction
in your code. GUI should be described appropriately in data files.

Glade does this very good, and with pygtk it''s no problem to use the XML files.

Reinhold


Reinhold Birkenfeld wrote:

Have to disagree strongly.

It''s evil anyway (for more complex applications) to put GUI construction
in your code. GUI should be described appropriately in data files.

Glade does this very good, and with pygtk it''s no problem to use the XML files.

Reinhold



So the GUI should be seperate from the code. Is the way i described
valid then? Extending from the gui class and putting event handlers in
the derived classes?
Or is there a better way to seperate the GUI from the code?

Benedict


这篇关于生成gui工具的解决方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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