Question concerning cross platform usage differences

Robin Dunn wrote:

Hi All,

...just a quick thanks for the replies to my previous post!

It seems that the wxMDIChildren of a wxMDIParentFrame are

handled a bit differently between Linux and Windows, for the

same code.

There is no such thing as MDI on Linux and so it is implemented as tabs

in a notebook. The notebook is the wxMDIClientWindow and the pages are

the wxMDIChildFrame.

I was aware of this from using *nix but had wondered how the wxPython/wxWindows

implementation was done such that the API would remain cross platform.

On Windows, where there is true MDI (although even Microsoft doesn't use

it anymore) the wxMDIClientWindow is the background behind the child

frames, but is technically a sibling of the child frames.

You can think of these differences as implementation details that most

of the time shouldn't matter.

I agree with the "most of the time" part. :slight_smile:

--------------------------------------------------------------------------------------------------

1. If the two-step frame construction process is used to create the MDIParentFrame

on the Windows platform, will the wxMDIClientWindow container then be used to store

the MDIChildren automatically?

No. On windows the MDIParentFrame is the parent of the MDIChildFrames.

On Linux the MDIParentFrame is the parent of the notebook and the

notebook is the parent window of the MDIChildren.

I'm not sure why all this matters though, why not just keep track of the

children yourself?

Why write code to keep track of something when it's already being done?

Unfortunately, the application was heavily developed on Windows initially by one

individual. Then a second individual, who mainly uses Linux, started helping out. But when

the app was run on Linux things stopped working. The problem was tracked down to the

child frame handling differences.

Being new to wxPython, much of the implementation is done by trial and error. Like keeping

track of the child frames for example. It's difficult to overlook the "GetChildren"

method in the documentation when initially trying to decide on the best approach to keep track

of the child frames - and the deal was sealed after doing a "print self.GetChildren()" with

a bunch of child frames open in the app. Why wouldn't an implementation want to use a

built-in method over a manual approach. Well, I know why now, but without the

information you provided here I would not have known. Accept of course for the fact

that our app was misbehaving when run on Linux.

2. If the answer to question 1 is yes, will this have any side-effects on the Linux

platform

in relation to the way the current wxMDIClientWindow functions. I.e., will a second

client window be created or is the two-step process ignored on Linux? Probably a

stupid question but I'll feel better knowing for certain... :slight_smile:

3. Has anyone successfully implemented the two-step frame creation process

for an MDIParent frame?

It should work exactly the same as for any other window.

4. If the answer to question 1 is no, then is there something that someone knows about

that

might be causing the discrepancy in behavior noted between the two platforms?

See above.

5 And lastly, if the two-step process won't change the behavior on the Windows platform,

is

there a way to get the client window to be used on the Windows platform, or conversely,

not

used when run on the Linux platform?

No.

Thanks for the info,

Joe

Joseph D. Poirier
DSP Software
IMN, Nokia Inc.
6000 Connection Drive
Irving, TX 75039

···

joseph.poirier@nokia.com wrote:

Why write code to keep track of something when it's already being done?

Unfortunately, the application was heavily developed on Windows initially by one
individual. Then a second individual, who mainly uses Linux, started helping out.

wxPython is very good at cross platform code, but there still are
differences, of course. I have always found that there is a cross
platfrom way to everything I try, but the first thing that works on one
platfrom is not always it. However the cross platform way is usually
better in other respects as well.

the app was run on Linux things stopped working. The problem was tracked down to the
child frame handling differences.

Perhaps you could add this to this Wiki Page (which you should read
anyway):

http://wiki.wxpython.org/index.cgi/wxPython_20Platform_20Inconsistencies

Why write code to keep track of something when it's already being done?
Like keeping track of the child frames for example.

Because it's more powerful and flexible that way..All of a Frame's
children are not neccessarily the same type or have the same function.
When you add a second type,. you'll be glad you've kept track of them
yourself.

-Chris

···

joseph.poirier@nokia.com wrote:

--
Christopher Barker, Ph.D.
Oceanographer
                                        
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

Having just completed a major project using wxPython, I can say that
this is probably the one biggest issue we faced, and one of the
biggest reasons that people later decided to toss Python altogether
and go with a Java-based solution (not my choice, but I was
overruled).

I think that for wxPython to be taken more seriously, we'll have to
address this problem. Hopefully the work Borland and the Chandler
project are doing will help in this regard.

···

On Thu, Dec 18, 2003 at 03:43:19PM -0800, Chris Barker wrote:

wxPython is very good at cross platform code, but there still are
differences, of course. I have always found that there is a cross
platfrom way to everything I try, but the first thing that works on
one platfrom is not always it. However the cross platform way is
usually better in other respects as well.

--
Tim Lesher <tim@lesher.ws>
http://www.lesher.ws

Tim,

Just curious, was the decision to toss (wx)Python based on
cross platform issues with Python or with wxPython? If it
was the latter, did you consider any other Python GUI kits?

/Jean Brouwers

···

On Thursday, December 18, 2003, at 08:55 PM, Tim Lesher wrote:

On Thu, Dec 18, 2003 at 03:43:19PM -0800, Chris Barker wrote:

wxPython is very good at cross platform code, but there still are
differences, of course. I have always found that there is a cross
platfrom way to everything I try, but the first thing that works on
one platfrom is not always it. However the cross platform way is
usually better in other respects as well.

Having just completed a major project using wxPython, I can say that
this is probably the one biggest issue we faced, and one of the
biggest reasons that people later decided to toss Python altogether
and go with a Java-based solution (not my choice, but I was
overruled).

I think that for wxPython to be taken more seriously, we'll have to
address this problem. Hopefully the work Borland and the Chandler
project are doing will help in this regard.

--
Tim Lesher <tim@lesher.ws>
http://www.lesher.ws

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

Tim Lesher wrote:

> wxPython is very good at cross platform code, but there still are
> differences, of course. I have always found that there is a cross
> platfrom way to everything I try, but the first thing that works on
> one platfrom is not always it. However the cross platform way is
> usually better in other respects as well.

Having just completed a major project using wxPython, I can say that
this is probably the one biggest issue we faced,

"this" being that the cross platfrom way is usually better in other
respects as well? *wink*

and one of the
biggest reasons that people later decided to toss Python altogether
and go with a Java-based solution (not my choice, but I was
overruled).

Because there are never any problems with JAVA code running differently
on different JVMs? And what GUI framework did you use for JAVA anyway?

If there really is a way to write cross platfrom apps that aren't "write
once..debug everywhere" I'd love to see it!

I think that for wxPython to be taken more seriously, we'll have to
address this problem. Hopefully the work Borland and the Chandler
project are doing will help in this regard.

With the addition resorces going into wxWindows development, it will get
better in all respects (and indeed has gotten much better over the years
before Chandler or Borland were involved), but frankly, I'm confused by
the decision your group made: the cross platfrom issues with wx are
pretty darn small, and any time spent on them is probably much less than
time wasted by using JAVA rather than Python. Frankly, were cross
platforms are biggest is where you try to use an idiom that is very
platfrom dependent, like MDI, which caused the OP's problem. How well
can JAVA/Swing do MDI on all platforms?

Also, the OP's problems were not just caused by platform differences,
but by sub-optimum design..the design will get better when the cross
platform issues are addressed. I've found this is often the case.

-Chris

···

On Thu, Dec 18, 2003 at 03:43:19PM -0800, Chris Barker wrote:

--
Christopher Barker, Ph.D.
Oceanographer
                                        
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

Just curious, was the decision to toss (wx)Python based on
cross platform issues with Python or with wxPython?

Strictly wxPython; the only issue with Python was the lack of
strong typing as an option, and that wasn't a deal-breaker.

If it was the latter, did you consider any other Python GUI kits?

wxPython was the only kit we found that met our crossplatform and
licensing requirements.

Unfortunately, in the minds of most of the people involved (even many
of the programmers), there wasn't any conceptual dividing line between
wxPython and Python, so any bug, crash, or inconsistency in wxPython
was labelled a "Python bug".

···

On Fri, Dec 19, 2003 at 08:12:23AM -0800, Jean Brouwers wrote:

--
Tim Lesher <tim@lesher.ws>
http://www.lesher.ws

Tim Lesher wrote:
> > wxPython is very good at cross platform code, but there still are
> > differences, of course. I have always found that there is a cross
> > platfrom way to everything I try, but the first thing that works on
> > one platfrom is not always it. However the cross platform way is
> > usually better in other respects as well.
>
> Having just completed a major project using wxPython, I can say that
> this is probably the one biggest issue we faced,

"this" being that the cross platfrom way is usually better in other
respects as well? *wink*

No, "this" being that in wxPython, the "one obvious way to do it" (to
quote Tim Peters) isn't always the correct way.

Because there are never any problems with JAVA code running differently
on different JVMs? And what GUI framework did you use for JAVA anyway?

No, it's now a J2EE/EJB-based solution. The web browser is now the
client. The decision was also partially political, but the
cross-platform wxPython issues made a convenient scapegoat.

If there really is a way to write cross platfrom apps that aren't "write
once..debug everywhere" I'd love to see it!

Python gets pretty close to it by itself, and where there are platform
differences, they're pretty well documented. Unfortunately, that's
not the case for wxWindows.

Also, the OP's problems were not just caused by platform differences,
but by sub-optimum design..the design will get better when the cross
platform issues are addressed. I've found this is often the case.

The two biggest issues (for us, at least) were that where there were
platform differences, the programmers had to find them by trial and
error, and that there were stability issues with invalid code: bad
calls into wxWindows tended to crash rather than produce useful
output.

Understand that the programmers involved were senior developers, but
they're used to having very stable, mature development environments
like Win32 and MFC (and don't laugh--the portions of Win32 equivalent
to wxWindows _are_ well-documented, well-known, and stable). They
pretty much freaked out when I suggested they download the
wxWindows/wxPython source to debug their problems, and were outright
insulted when I suggested that they submit a patch.

How I ended up on the (C++) server team and they ended up on the
(Python/wxPython) client team, I'll never know... <wink>.

···

On Fri, Dec 19, 2003 at 09:15:07AM -0800, Chris Barker wrote:

> On Thu, Dec 18, 2003 at 03:43:19PM -0800, Chris Barker wrote:

--
Tim Lesher <tim@lesher.ws>
http://www.lesher.ws

Tim,

Did Win32/MFC win over python/wxpython? or did you mean that the senior
developers decided that a J2EE/EJB-web browser solution had more stable and
mature tools/technology than a python/wxpython solution (i.e. the senior
developers dropped Win32/MFC coding and are now coding with java,
javascript, html, etc)?

Thanks,
RGC

Is it fair to say that your company's decision was more political than
technical?

···

-----Original Message-----
From: Tim Lesher [mailto:tim@lesher.ws]
Sent: Friday, December 19, 2003 8:58 PM
To: wxPython-users@lists.wxwindows.org
Subject: Re: [wxPython-users] Question concerning cross platform usage
differences

On Fri, Dec 19, 2003 at 09:15:07AM -0800, Chris Barker wrote:

Tim Lesher wrote:
> On Thu, Dec 18, 2003 at 03:43:19PM -0800, Chris Barker wrote:
> > wxPython is very good at cross platform code, but there still are
> > differences, of course. I have always found that there is a cross
> > platfrom way to everything I try, but the first thing that works on
> > one platfrom is not always it. However the cross platform way is
> > usually better in other respects as well.
>
> Having just completed a major project using wxPython, I can say that
> this is probably the one biggest issue we faced,

"this" being that the cross platfrom way is usually better in other
respects as well? *wink*

No, "this" being that in wxPython, the "one obvious way to do it" (to
quote Tim Peters) isn't always the correct way.

Because there are never any problems with JAVA code running differently
on different JVMs? And what GUI framework did you use for JAVA anyway?

No, it's now a J2EE/EJB-based solution. The web browser is now the
client. The decision was also partially political, but the
cross-platform wxPython issues made a convenient scapegoat.

If there really is a way to write cross platfrom apps that aren't "write
once..debug everywhere" I'd love to see it!

Python gets pretty close to it by itself, and where there are platform
differences, they're pretty well documented. Unfortunately, that's
not the case for wxWindows.

Also, the OP's problems were not just caused by platform differences,
but by sub-optimum design..the design will get better when the cross
platform issues are addressed. I've found this is often the case.

The two biggest issues (for us, at least) were that where there were
platform differences, the programmers had to find them by trial and
error, and that there were stability issues with invalid code: bad
calls into wxWindows tended to crash rather than produce useful
output.

Understand that the programmers involved were senior developers, but
they're used to having very stable, mature development environments
like Win32 and MFC (and don't laugh--the portions of Win32 equivalent
to wxWindows _are_ well-documented, well-known, and stable). They
pretty much freaked out when I suggested they download the
wxWindows/wxPython source to debug their problems, and were outright
insulted when I suggested that they submit a patch.

How I ended up on the (C++) server team and they ended up on the
(Python/wxPython) client team, I'll never know... <wink>.

--
Tim Lesher <tim@lesher.ws>
http://www.lesher.ws

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

I apologize for conflating two issues.

During development, the programmers were frustrated with the
crossplatform issues and the state of documentation compared with
their most familiar platform (Win32/MFC).

After delivery, folks outside the immediate team seized on these
issues to move the project as a whole to _their_ preferred
crossplatform solution, the J2EE/EJB platform.

I don't agree with either of these positions.

···

On Fri, Dec 19, 2003 at 11:43:13PM -0500, Russell Christopher wrote:

Did Win32/MFC win over python/wxpython? or did you mean that the senior
developers decided that a J2EE/EJB-web browser solution had more stable and
mature tools/technology than a python/wxpython solution (i.e. the senior
developers dropped Win32/MFC coding and are now coding with java,
javascript, html, etc)?

--
Tim Lesher <tim@lesher.ws>
http://www.lesher.ws

At this moment,I know I would have trouble winning over management to sign
off on a python solution versus a J2EE/EJB solution for reasons like I'm
still learning python (python is next to unknown to management and J2EE is
not) and I'm a relative newbie to wxpython. Currently, I am finding wxpython
practical as a RAD tool to build small GUI apps to control/test an XMLRPC
component in the backend. So I'm slowly getting to know wxpython well enough
to feel comfortable building (more significant) rich GUI client solutions in
wxpython. ... for me cross platform is a less onerous thing, requiring
support of only one platform but having the means to move to another
platform w/o having to rewrite the entire application (i.e. wxWindows has
done the hard cross platform stuff).

···

-----Original Message-----
From: Tim Lesher [mailto:tim@lesher.ws]
Sent: Saturday, December 20, 2003 12:38 AM
To: wxPython-users@lists.wxwindows.org
Subject: Re: [wxPython-users] Question concerning cross platform usage
differences

On Fri, Dec 19, 2003 at 11:43:13PM -0500, Russell Christopher wrote:

Did Win32/MFC win over python/wxpython? or did you mean that the senior
developers decided that a J2EE/EJB-web browser solution had more stable

and

mature tools/technology than a python/wxpython solution (i.e. the senior
developers dropped Win32/MFC coding and are now coding with java,
javascript, html, etc)?

I apologize for conflating two issues.

During development, the programmers were frustrated with the
crossplatform issues and the state of documentation compared with
their most familiar platform (Win32/MFC).

After delivery, folks outside the immediate team seized on these
issues to move the project as a whole to _their_ preferred
crossplatform solution, the J2EE/EJB platform.

I don't agree with either of these positions.

--
Tim Lesher <tim@lesher.ws>
http://www.lesher.ws

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

Tim,

First, I understand that this wasn't your decision, but I just can't help myself. Also, perhaps we can all learn from this when advocating for our preferred development tools.

Tim Lesher wrote:

wxPython was the only kit we found that met our crossplatform and
licensing requirements.

And yet they're happy with VC++, Win32, etc. What can you do with those that you can't do with QT?

Unfortunately, in the minds of most of the people involved (even many
of the programmers), there wasn't any conceptual dividing line between
wxPython and Python, so any bug, crash, or inconsistency in wxPython
was labelled a "Python bug".

This is very unfortunate. On the one hand, it makes some sense if you are writing a GUI app, and wxPython is the only GUI option, then it really makes no difference where the bugs are. However...

> No, it's now a J2EE/EJB-based solution. The web browser is now the
> client.

So Python was rejected because wxWindows is not as quite as platform dependent a GUI as we would all like, then JAVA was chosen to implement a Web browser based app. So logical!

The decision that even with wxPython, cross platform GUI apps are too much work is reasonable, but of course, whether to make a browser based app or a custom client is independent of the language/in either case. (Yes, not quite: how good the tools available are will influence the decision)

No, "this" being that in wxPython, the "one obvious way to do it" (to
quote Tim Peters) isn't always the correct way.

That's a fantasy anyway (though a nice one), But what's obvious does depend on what platform you're used to coding for.

If there really is a way to write cross platfrom apps that aren't "write
once..debug everywhere" I'd love to see it!

Python gets pretty close to it by itself, and where there are platform
differences, they're pretty well documented.

Well, ANSI C is pretty good, too...until you try to use system libraries! X-platform GUIs are hard...none of the OS vendors are trying to make it easy..quite the opposite, in fact.

The two biggest issues (for us, at least) were that where there were
platform differences, the programmers had to find them by trial and
error,

Or reading the Wiki...did they even do that? More importantly, did they add to the Wiki? I doubt it, it sounds like this is not a very Open Source community friendly group.

and that there were stability issues with invalid code: bad
calls into wxWindows tended to crash rather than produce useful
output.

This is really a big problem, But I'm surprised that it would bother C++ programmers...aren't crashes exactly what happens when you make a mistake in C/C++? Anyway, it is a big issue. Ideally, in Python, you should never crash the interpreter, and, of course a useful error message would be particularly helpful. However, it just doesn't happen that often these days.

Understand that the programmers involved were senior developers, but
they're used to having very stable, mature development environments
like Win32 and MFC (and don't laugh--the portions of Win32 equivalent
to wxWindows _are_ well-documented, well-known, and stable).

Maybe.. I argue well-documented than stable, at least in the sense of things working the same on the various versions of Windows.

I suspect that these folks have never tried to write a cross platfrom app: I can assure you that wxWindow/Python works better that MFC for Macintosh. (And yes, that did once exist, although maybe only as vaporware)

They
pretty much freaked out when I suggested they download the
wxWindows/wxPython source to debug their problems.

You know, I've never had to do that. I suspect that they were reluctant to post questions here. I've found that the developers I work with that aren't used to open source never think to post a question to the users groups. They are used to just searching the docs..or having to pay for tech support.

Anyway, there are legitimate limitation of both wxPython itself, but it sounds like your group made decisions for some pretty poor reasons...Oh well.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer
                                         
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov