本文介绍了预订wxPython?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以推荐一本关于wxPython的好书吗?在wxPython上有书吗?


我一直在努力学习wxPython和/或蜡几周,

,我只是没有得到它。 [几年前我写了一个小的

wxPython应用程序,这是一个剪切/粘贴,试用

和错误的练习。]


wxWindows似乎比我用过的其他GUI更低级别(Tk,GTK和Trestle [1]),而且全部都是

在wxWindows / wxPython中对暴露的细节进行排序,我觉得很奇怪。


例如,我仍然对如何判断

" parent"一个小部件应该是。当您将StaticBox放在

面板中时,Panel是StaticBox的父级。当你在StaticBox中放置

SomeOtherWidget时,为什么是

的父亲是SomeOtherWidget的Panel而不是StaticBox?


And sizer怎么样?它们似乎是一种平行的,小部件的幻像树,它们被困在真正的小部件树的一侧,而其他GUI工具包则处理布局小部件

(网格,hbox,vbox等)作为一流的那些

的小部件与实际绘制的小部件位于同一个树中

的东西。


无论如何,我真的喜欢在wxPython上找到一本好书。我是

仍在使用wxPython教程,我已经阅读了

一些wxWindows(它们的价值有限

有人坚定地决定对C ++保持一无所知。


我还在读wiki.wxpython.org上的东西,但是Wikis

总是显得那么零散......


[1]我仍然认为

Trestle使用的hbox / vbox / glue抽象是最容易使用的之一。可能是因为

我已经使用TeX和LaTeX 25年了。


-

Grant Edwards grante哇!我如何获得HOME?



visi.com

Can anybody recommend a good book on wxPython? Are there any
books on wxPython?

I''ve been trying to learn wxPython and/or wax for a few weeks,
and I''m just not getting it. [I wrote and shipped one small
wxPython app a couple years ago, and it was a cut/paste, trial
and error sort of exercise.]

wxWindows seems to be more low-level than the other GUI
toolkits I''ve used (Tk, GTK, and Trestle[1]), and there are all
sorts exposed details in wxWindows/wxPython that I find weird.

For example, I''m still confused about how to tell what the
"parent" of a widget should be. When you put a StaticBox in a
Panel, the Panel is the parent of the StaticBox. When you put
SomeOtherWidget in the StaticBox, why is the parent of
SomeOtherWidget the Panel and not the StaticBox?

And what about sizers? They seem to be a sort of parallel,
phantom tree of widgets that''s stuck on the side of the real
tree of widgets, while other GUI toolkits treat layout widgets
(grids, hboxes, vboxes, etc) as a "first-class" widgets that
reside in the same tree as the widgets that actually draw
stuff.

Anyway, I''d really love to find a good book on wxPython. I''m
still working through wxPython tutorials, and I''ve read through
some of the wxWindows ones (which are of limited value for
somebody steadfastly determined to remain clueless about C++).

I''m also still reading stuff on wiki.wxpython.org, but Wikis
always seem so fragmented...

[1] I still think the hbox/vbox/glue abstraction used by
Trestle was one of the easiest to use. Probably because
I''ve been using TeX and LaTeX for 25 years.

--
Grant Edwards grante Yow! How do I get HOME?
at
visi.com

推荐答案




我赞赏你为保持C ++免费所做的努力,我真诚地希望你能比我更幸运地获得这个努力!


您可能会发现仔细阅读wxPython示例比阅读那些阴险的c ++教程更有帮助。 WxPython演示包含一个全面的

示例集合,展示了如何使用几乎所有单个小部件。

你可能想看看它。


--SegPhault



I applaud your efforts to stay C++ free, and I sincerely hope you have
more luck in that endeavor than I did!

You might find that perusing wxPython examples helps more than reading
those insidious c++ tutorials. The WxPython demo includes a comprehensive
collection of examples, showing how to use just about every single widget.
You might want to take a look at it.

--SegPhault




wxWindows远未达到低水平。



wxWindows is far from low level.




我的意思是低 - 等级,有一个你好

世界来自O''Reilly的一本书的例子我早些时候跑过这个

晚上:< http://www.onlamp.com/lpt/a/196>。 Tkinter示例

是5行代码,包括一个按钮,当它被推送时执行

命令。 wxPythonhello world example

是代码行的两倍,只是一个空框架:它

甚至不包含按钮(那就是已经使它成为三行代码的b
倍。使用Tk,很多低级别的b $ b详细信息会自动处理,但在wxWindows中,你手动执行这些操作需要

。也许这会让你获得灵活性,但是如果你不需要那种灵活性,那么你所获得的就是痛苦:

这是一行代码Tk似乎通常是wxPython中的三到四行代码。


另一个例子:当你创建一个小部件时,你必须告诉它
父母是
。然后在一个单独的操作中,你必须告诉父母关于孩子的
。为什么

子/父之间的链接设置在两个地方?这只是一个等待发生的错误:b
拆分单个信息并在源代码中的两个不同位置放置两个半部分

根据我的经验,他们必须保持音乐会一直被证明是一件糟糕的事情。你为什么不能把你孩子的操作添加到父母那里也把孩子的父母加成?孩子实际上需要知道孩子的父母在孩子的创造和孩子被添加之间的间隔期间是谁?

给它的父母?也许确实如此。

在两个独立的操作中进行父/子联动是否有优势?

也许有。但是当没有解释为什么

额外的复杂性/脆弱性会为你买单时,它只会看起来有点破坏和低级别。


最后一个例子,在前一个帖子中我已经开始讨论关于整数小部件和事件ID的

并单独

"关联”用于连接处理程序,事件和

小部件的函数。在创建窗口小部件或让窗口小部件具有属性或获取/设置可用于
可调用级别低得多br />
设置事件的可调用对象。再一次,wxWindows方法有一些额外的灵活性,但我不需要那些我写的应用程序的灵活性,所以我得到的只是

编写三行代码的乐趣。


它有点像C与Python:C是一种低级语言,所以

你可以更灵活地控制很多东西。

的灵活性是昂贵的:你必须编写更多代码行,

并且代码更难以阅读,调试和维护。

由于程序员负责更多细节,

更多细节是错误的。

它是一个跨平台兼容的包装器,位于

不,不仅仅是语法,但是一些基本的架构

设计似乎对我来说更低级别。例如,Sizer,

似乎是事后的想法,你必须手动将它们粘贴到你的小部件上。该功能是

的一部分,是其他GUI工具包的基本设计,只是自动发生了


人们说WAX修复了这个问题。 (我从来没有用过它)


我正在尝试打蜡,这绝对是一种改进,但

它''尚未准备好生产。我想要的其中一个小部件

使用起来并不正常,而且由于w * Windows的巴洛克风格,似乎没有人知道原因。我将要修复一些错误,但我需要了解更多关于

wxWindows和wxPython以及sizer等等。我现在这样做。

因此搜索文档。我找到的一个页面说

sizer是用纯Python编写的,因此不是

wxWindows的一部分,关于如何使用它们的文档,你应该

请参阅wxWindows手册。嗯?



For an example of what I mean by low-level, there''s a "hello
world" example from an O''Reilly book I ran across earlier this
evening: <http://www.onlamp.com/lpt/a/196>. The Tkinter example
is 5 lines of code and includes a button that executes a
command when it''s pushed. The wxPython "hello world example"
is twice as many lines of code and is just an empty frame: it
doesn''t even include the button (that would have made it three
times as many lines of code). With Tk, a lot of the low-level
details are handled automatically, but in wxWindows, you have
to do them manually. Perhaps that gains you flexibility, but if
you don''t need that flexibility, all it gains you is pain:
something that''s one line of code in Tk seems to be typically
three or four lines of code in wxPython.

Another example: When you create a widget you have to tell it
who its parent is. Then in a separate operation, you have to
tell the parent about the child. Why is the link between
child/parent set in two places? That''s just a bug waiting to
happen: splitting up a single piece of information and putting
the two halves in two different places in the source code where
they have to be maintained in concert has always proven to be a
bad thing in my experience. Why can''t the operation where you
add a child to a parent also add the parent to the child? Does
the child actually need to know who its parent is during the
interval between the child''s creation and the child being added
to its parent? Perhaps it does. Is there an advantage to
doing the parent/child linkage in two separate operations?
Perhaps there is. But when there''s no explanation of what the
extra complexity/fragility buys you, it just looks sort of
broken and "low-level".

For a final example, in a previous thread I already went on and
on about the integer widget and event IDs and separate
"linking" functions used to connect handlers, events, and
widgets. That seems much lower-level than just passing the
callable when you create the widget or letting the widget
object have attributes or get/set methods that can be used to
set up the callable for an event. Again, there is some added
flexibility to the wxWindows approach, but I don''t need that
sort of flexibility for the apps I write, so all I get is the
fun of writing triple the lines of code.

It''s sort of like C vs. Python: C is a lower-level language, so
you have more flexible control over many things. That
flexibility is expensive: you have to write more lines of code,
and that code is much harder to read, debug, and maintain.
Since the programmer is responsible for more of the details,
more of the details are wrong.
it is a cross-platform compatible wrapper that sits on top of
other toolkits. (Gtk on linux, for instance) It seems
''low-level'' because the python bindings have very unpythonic
syntax.
No, not just the syntax, but some of the basic architectural
design seems to be more low-level to me. Sizers, for example,
appear to be an afterthought, and you have to sort of stick
them onto your widgets manually. That functionality is part of
the fundamental design of other GUI toolkits and just happens
automatically.
People say that WAX fixes this. (I''ve never used it)
I''m trying out wax, and it''s definitely an improvement, but
it''s not ready for production yet. One of the widgets I want
to use doesn''t work right, and due to the baroqueness of
wxWindows, nobody seems to know why. I''m going to take a whack
at fixing some bugs, but I''ll need to know a lot more about
wxWindows and wxPython and sizers and whatnot than I do now.
Hence the search for documentation. One page I found said that
sizers were written in pure Python and therefore not part of
wxWindows, and for documentation on how to use them, you should
consult the wxWindows manuals. Huh?



我赞赏你为保持C ++免费所做的努力,我真诚地希望你能比我更有运气!



I applaud your efforts to stay C++ free, and I sincerely hope
you have more luck in that endeavor than I did!




到目前为止,非常好。

您可能会发现,阅读wxPython示例有助于阅读那些阴险的c ++教程。 WxPython演示包含一个全面的示例集合,展示了如何使用几乎所有单个小部件。
您可能需要查看它。



So far, so good.
You might find that perusing wxPython examples helps more than reading
those insidious c++ tutorials. The WxPython demo includes a comprehensive
collection of examples, showing how to use just about every single widget.
You might want to take a look at it.




我一直在仔细查看这些内容,我仍然对很多东西感到困惑(例如父链接和sizer)。


我在业余时间打印了一些wxpywiki页面...


-

Grant Edwards grante哇!我想知道我是否应该告诉他们我的

visi.com以前的生活是完整的

STRANGER。



I''ve been looking through those, and am still confused about a
lot of things (e.g. parent links and sizers).

I printed out some wxpywiki pages to read in my spare time...

--
Grant Edwards grante Yow! I wonder if I ought
at to tell them about my
visi.com PREVIOUS LIFE as a COMPLETE
STRANGER.




这篇关于预订wxPython?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-27 03:44