[wxPython] Programming portably

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[wxPython] Programming portably

Mark Carroll
I'm looking in outline at the prospect of developing a non-trivial
application that will need to do some TCP/IP stuff and provide a
reasonable GUI. What I would really like is extremely easy porting between
the Mac, Win32 and Linux.

Right now I've no experience of wxWindows, Python or the Mac. (I do most
of my programming with C++, Lisp, Perl, Modula-3, etc.) I am, however,
willing to learn new things if I know that I'll be using the right tools
for the job in the end.

So, basically, my questions are:

(a) How far along are the Win32, Linux and Mac versions of wxPython? I get
the impression that the Mac version is furthest behind; anyone have any
idea how patient I'd have to be for that? (Development's likely to take
some months anyway.)

(b) Is porting likely to be trivial? e.g. is Python's TCP/IP stuff pretty
much the same on different platforms?

Thanks. (-: Otherwise I guess I'll look at Tcl/Tk or Java or something.

-- Mark


_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users



Reply | Threaded
Open this post in threaded view
|

Re: [wxPython] Programming portably

Robin Dunn
>
> So, basically, my questions are:
>
> (a) How far along are the Win32, Linux and Mac versions of wxPython? I get
> the impression that the Mac version is furthest behind; anyone have any
> idea how patient I'd have to be for that? (Development's likely to take
> some months anyway.)
>

Yes, the Mac version is actually just getting started (this week in fact.)
Initial reports are that most of the code compiles, so I am taking that as a
good sign.

Hopefully I will be able to find somebody to donate a Mac to the project so
I can help with the port and then be able to produce syncronized releases
across all platforms, provide support for all platforms, etc.


> (b) Is porting likely to be trivial? e.g. is Python's TCP/IP stuff pretty
> much the same on different platforms?
>

My understanding is that it is.  The python docs say that the standard
socket module is provided in PythonMac, so it should be at least Real Close.
A good place to ask this and get a definite answer is on the PythonMac SIG,
([hidden email])


> Thanks. (-: Otherwise I guess I'll look at Tcl/Tk or Java or something.
>

Oh no!  He said the J-word!  <grin>

--
Robin Dunn
Software Craftsman
[hidden email]
http://AllDunn.com/robin/
http://AllDunn.com/wxPython/  Check it out!



_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users



Reply | Threaded
Open this post in threaded view
|

[wxPython] Blit, Mask & other graphics stuf...

Fred Pacquier-2
In reply to this post by Mark Carroll

Hello, list :-)

I'm trying to get a feel for wxPython (and, mostly, Python itself) by
porting an old app I did in straight C under Windows 3... ages ago :)

It shuffles around graphics quite a lot so I've been fooling about with
context DCs, bitblts, and such. But there are a few things I can't
quite work out between the wxWindows documentation and the
wxPython implementation... for a start:

- the wxWindows doc has this for wxDC.Blit:

bool Blit(long xdest, long ydest, long width, long height, wxDC*
source, long xsrc, long ysrc, int logicalFunc, bool useMask)

However, if I pass the last (useMask) parm, python complains that
there are too many args. Does it default to something ?

- masks again : wxBitmap.Setmask is described as:

wxBitmap::SetMask
void SetMask(wxMask* mask)
Sets the mask for this bitmap.
Remarks
The bitmap object owns the mask once this has been called.

How do you "unselect" the mask from the bitmap afterwards ? I see
mentions elsewhere of wxNullMask and wxNullBitmap, but wxPython
doesn't seem to like them...

- image formats: is the GIF format handler particularly slow under
Windows ? I first tried to create bitmaps by loading a few gif files
and the program took ages to initialize. Then I took out the handler,
converted the gifs to (much bigger) BMPs, loaded them directly and
it starts instantly. is this normal behaviour ?

Thanks & sorry for being dense,
fp


_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users



Reply | Threaded
Open this post in threaded view
|

Re: [wxPython] Blit, Mask & other graphics stuf...

Robin Dunn
>
> - the wxWindows doc has this for wxDC.Blit:
>
> bool Blit(long xdest, long ydest, long width, long height, wxDC*
> source, long xsrc, long ysrc, int logicalFunc, bool useMask)
>
> However, if I pass the last (useMask) parm, python complains that
> there are too many args. Does it default to something ?
>

Early on in the project when I tried to add support for useMask I got a
compile error so I left it off.  Looking at it now it is definitly fixed for
both platforms so I'll add it back in and it will be there in the next
release.


> - masks again : wxBitmap.Setmask is described as:
>
> wxBitmap::SetMask
> void SetMask(wxMask* mask)
> Sets the mask for this bitmap.
> Remarks
> The bitmap object owns the mask once this has been called.
>
> How do you "unselect" the mask from the bitmap afterwards ? I see
> mentions elsewhere of wxNullMask and wxNullBitmap, but wxPython
> doesn't seem to like them...
>

wxNullBitmap should be there already.  I'll add wxNullMask.


> - image formats: is the GIF format handler particularly slow under
> Windows ? I first tried to create bitmaps by loading a few gif files
> and the program took ages to initialize. Then I took out the handler,
> converted the gifs to (much bigger) BMPs, loaded them directly and
> it starts instantly. is this normal behaviour ?
>

I don't know, I've never compared times.  How are you creating the bitmaps
from gifs?  Using wxBitmap with the wxBITMAP_TYPE_GIF flag or using wxImage
and ConvertToBitmap()?

Also, I hear that the internal GIF image handler is being rewritten so maybe
performance is being addressed...

--
Robin Dunn
Software Craftsman
[hidden email]
http://AllDunn.com/robin/
http://AllDunn.com/wxPython/  Check it out!



_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users