This topic brought up an issue that has been in my mind lately, prompted
by a few postings in various places lately.
[...]
What I'm wondering is if there is some fundamental way to make
wxPython less hard-crash prone. I dont' know enough about C++ to
know if this is even remotely possible, but what I'm imagine is
something akin to a try: except: wrapped around everything
wxWindows, so it just plain couldn't hard crash.
The thing about segfaults... is that (at least in unix), though they
can be caught, they typically can't really be handled in any
meaningful or useful way: after a segfault is caught and a handler
run, assuming that the handler returns, execution goes back to right
before the instruction that caused the segfault, assuming that it'll
go better this time. This means that whatever address was inaccessible
before the segfault-handler ran had better be accessible after the
handler returns, or you'll get caught in a loop. Typically, this means
that your segfault-handler had better just not return (e.g.: cause the
program to exit or restart itself). So, it's generally a better
solution to just avoid causing the segfaults in the first
place. Sometimes, though..., that's hard :\
Admittedly, I have no idea where wxPython stands relative to being
able to handle this problem....
Another note I recetnly saw is a letter from Edward Ream about why he
chose Tkinter over wxPython:
[...]
I'm writing this mostly to help work out my thoughts about it, as I just
havn't had the same experience as he did. In fact, while I agree with
his criticism that wxPython often feels too low level, I also am
grateful that I have the low level access when I need it.
Hm. Now, I find this interesting, because my view-point is pretty-much
the opposite: wxWindows is very *high-level*--excessively so, at
times.
Most of the time, I'm very glad that I don't have to go through what I
would have to with Tkinter--things like building scrollbars and
associating them with all of my windows, or implementing my own
progress-meter or other widgets. There's a great collection of
prefabricated widget-types, and they all come with all of the
amenities built-in, and I -love- that..., most of the time.
wx was especially nice when I was new to GUI-programming, but there
are now times when I think things like: the standard scrollbars are
missing something, so I'll make my own; I just need to make my
TextCtrls -without- scrollbars, and... d'oh--I can't make a TextCtrl
without scrollbars.
Various container-widgets in wx are quite constrained, compared to the
GTK+ widgets that they wrap--let's take buttons and trees, for example: in
wxWindows, buttons have textual labels, and trees-nodes are
text-labels. In GTK+, these things are generic containers--if I
wanted, I could build a button with a tree in it, or a tree full of
buttons that each contained pictures, or whatever (not that I've had
any desire to do either of those exact things, yet...). Sure, I can
put text-labels in them, but that's not because there's something
special about it.
I'm really glad that wx's TreeCtrls have built-in editable-nodes
facilities--last I looked, it didn't look like GTK+'s trees
did--it could be done, but I'd have to write the extra code to do
it. I'm really glad that I don't have to do that..., but..., I can't
get a reference for that text-input widget that's used for the
tree-node's editor, so I can't add any key-bindings or any other
interesting or useful features to it, and I can't get it handle
edit-cancels the way that I want.
Note that I didn't say `it's hard to'--I said `I can't'. So, every
once in a while, I think about switching over to GTK+ (or to Tk) and
just sucking up the `I'd have to write more code to do X' point,
because, at least it'd be -possible- to do Y. Right now, it
effectively costs me an -infinite- amount of code to do Y, so I guess
the total cost of X+Y really -isn't- less than it would be if I wasn't
using wx
So, it's interesting to see someone talking about how wx feels `too
LOW-level'
Of course, I'm not really complaining--it's just that others are
sharing, so I thought that I'd join in
For some of these things, Robin has pointed me to wx-dev, and I have
to admit that I've yet to actually follow up because, really, I still
have other, larger problems of my own origination with which to
deal. Furthermore, if I wasn't so engrossed in those `other, larger
problems' (you know, the `oh, if I had the time...' argument), I
probably could have remedied some of my problems with wx. I admit
it--I'm a lazy bastard
All things considered, I do think that Julian and Robin and co. have
done a great job providing a toolkit that does what it does, and I
commend them..., but I'm not sure whether it's going to end up being
the right thing for me.
···
On Wed, Apr 23, 2003 at 04:52:27PM -0700, Chris Barker wrote:
--
"I actually started at one school and they taught C.... My other
school, when I transferred, used Scheme. Attacked `how to program'
from a completely different angle, and actually taught programming
techniques, not how to over-come syntax problems." --Anonymous