wxPython

Mojca Miklavec mojca at macports.org
Tue Dec 12 11:40:49 UTC 2017


On 11 December 2017 at 04:11, Ulrich Wienands wrote:
> Many thanks. It looks like I should stay with tkinter, then. It seems to work (with Python 3.6) even if I need X11 to use it.

You don't need to use X11 for Tkinter. Just install "tk +quartz" and
then you'll get a native UI. The default is "tk +x11" and is a bit
difficult to change without breaking a number of ports.

> I am new to Python so Python 2 or 3 is not critical in the sense of maintaining older code; but from what I have seen around the web it looks like Python 3 finally has become enough mainstream that I should start with it rather than Python 2. I need things like numPy et al., and there are versions that work with Python 3.6 on MacPorts so that is what is presently installing on my machine.

If you are writing the app from scratch, I would suggest you to do a
bit more research now as that will influence your future coding in a
quite significant way. For example, if you wrote your app in wxWidgets
long time ago, there would be no way to port it to Python three untill
just about now (and even now it's not yet distributed with majo)

You can easily experient with wxWidgets and Python 2.7 for that and
compare which one gives you more flexibility.

As far as compatibility is concerned: wxWidgets tend to supoort a
slightly more limited set of platforms and macOS versions. If you use
Tk, you'll probably be able to use the code on almost any given OS
version, while wxWidgets might be problematic when a new OS version
comes out and older versions get dropped as time passes. That said,
maybe wxWidgets will give you more different fancy elements, even
though they do lack mac developers in general, so probably no
latest-and-greatest features from keynote talks from Apple until a few
years pass and users start demanding that. But Tk won't give you
multi-finger gesture support either.

Another thing to note: I assume that wxPython 4 has quite a bit
different API than wxPython 3. So every now and then when you need to
upgrade your app you might have to change quite a bit of code.
Hopefully this is more or less the last big change, but just to warn
you.

Anyway ... I tried compiling wxPython 4.0.0b2, but it failed to
compile. It must have been a trivial solvable problem. If you are into
patching C++/Objective C, I can send you a sample Portfile to continue
from there. I'll look into it one day, but I cannot promise when.

Mojca


More information about the macports-users mailing list