wxPython: Procedural or OOPS? installation woes etc...

Steve Holden sholden at holdenweb.com
Fri Apr 6 07:50:45 EDT 2001


"Ron Stephens" <rdsteph at earthlink.net> wrote in message
news:3ACC27AB.1A13151 at earthlink.net...
> Can anyone tell me whether wxPython uses a procedural approach to event
> driven gui programming, or an object oriented one like Tkinter does???
> Don't get me wrong, i am determined to stick it out with Tkinter and
> eventually learn it, btu I wouldn't mind a procedural alternative....
>
The dichotomy is not between prcedural and object-oriented, but between
linear-monolithic (what I sometimes call "we ask the questions") and
event-driven.

Any program which uses a GUI has to create data structures which relate the
window structures to the events which a user can trigger, and both wxPython
and Tkinter do the latter by establishing "callbacks", which are snippets of
code (usually functions) to be called when particular events occur.

Window-based programming has always been like this: the initialization
builds the windows structures, and then calls a "wait-for-event" loop which
effectively idles the program until some relevant event occurs. Then the
appropriate callback is triggered, allowing the program to take action in
response.

This can be done just as "easily" in C as in object-oriented languages like
Python. But the style does take a little getting used to.

> Also, I downloaded and unpacked the windows version of wxPython. When I
> click on wx.py to begin using wxPython, it opens an MS DOS python window
> but flashes through some traceback messages too quickly for me to read
> them, and then closes out the MS DOS window. Can anyone give me a clue
> here?? I guess installing wxPython is more involved than just unzipping
> and running an exe installation program...
>
Well, my installation went just like that! Take a look for demo.py, which
should have installed in your Start menu under wxPython. It is a very
comprehensive demonstration of the package's features, and makes the code
for these easily available.

Good luck.

regards
 Steve






More information about the Python-list mailing list