whole windows and controls are right to left - how to disable?

http://i56.tinypic.com/9aa8p1.jpg

i tried to run Boa Constructor, a wxPython program, and for some
reason its windows and controls are all right-to-left, and the texts
inside are translated into spanish.

Since Boa Constructor didn't update for half a decade, It's probably a
new behavior of wxPython. Is it?

My Windows XP has an English interface, and all other windows in the
system are left to right, "as it should be" because RTL windows are
(from my point of view) plain wrong, for several reasons.

The locale is (probably) defined to be hebrew, and I didn't set
anything to spanish, for sure.

Where should I check?
How to disable the RTL windows?

Thanks

actually, it's far worse than i thought

http://i52.tinypic.com/f56fc1.png

i didn't know it's even POSSIBLE.
the actual font inside the text widget is mirrored at the letter
level! ftw.

i have never seen something like this (i'm a Windows programmer for 15
years),

other wxpython programs on my computer works fine (so far...)

settings:
windows xp,
python 2.5.4
wxpython 2.8.11

···

On Oct 17, 11:28 pm, shuki <asafgreenb...@gmail.com> wrote:

http://i56.tinypic.com/9aa8p1.jpg

i tried to run Boa Constructor, a wxPython program, and for some
reason its windows and controls are all right-to-left, and the texts
inside are translated into spanish.

Since Boa Constructor didn't update for half a decade, It's probably a
new behavior of wxPython. Is it?

My Windows XP has an English interface, and all other windows in the
system are left to right, "as it should be" because RTL windows are
(from my point of view) plain wrong, for several reasons.

The locale is (probably) defined to be hebrew, and I didn't set
anything to spanish, for sure.

Where should I check?
How to disable the RTL windows?

Thanks

Yes, IIRC wx will set the layout direction based on the defaults for the locale. I see that there is a GetLayoutDirection for the wx.App class, but no SetLayoutDirection there. The wx.Window and wx.DC classes do have a SetLayoutDirection however so one way to override it would be to call SetLayoutDireciton for the top-level frames. It will probably also work to change the locale when the application first starts up, before the frames are created, something like:

  self.locale = wx.Locale(wx.LANGUAGE_ENGLISH_US)

You need to hold the reference to the locale otherwise it will revert back to the previous locale when it goes out of scope.

···

On 10/17/11 2:28 PM, shuki wrote:

http://i56.tinypic.com/9aa8p1.jpg

i tried to run Boa Constructor, a wxPython program, and for some
reason its windows and controls are all right-to-left, and the texts
inside are translated into spanish.

Since Boa Constructor didn't update for half a decade, It's probably a
new behavior of wxPython. Is it?

My Windows XP has an English interface, and all other windows in the
system are left to right, "as it should be" because RTL windows are
(from my point of view) plain wrong, for several reasons.

The locale is (probably) defined to be hebrew, and I didn't set
anything to spanish, for sure.

Where should I check?
How to disable the RTL windows?

--
Robin Dunn
Software Craftsman

actually, it's far worse than i thought

http://i52.tinypic.com/f56fc1.png

i didn't know it's even POSSIBLE.
the actual font inside the text widget is mirrored at the letter
level! ftw.

That is very weird, probably at least partially due to StyledTextCtrl not paying any attention at all to the layout direction settings...

other wxpython programs on my computer works fine (so far...)

Hmmm... So probably something that Boa is doing is triggering this. BTW, there is probably a newer version of Boa code in their CVS repository. A snapshot of Boa's code from there is almost always in a runnable and usable state.

···

On 10/17/11 2:47 PM, shuki wrote:

--
Robin Dunn
Software Craftsman

thanks.
i worked around the bug.

Boa.py: self.locale = wx.Locale(Preferences.i18nLanguage)
Preferences.py: i18nLanguage = wx.LANGUAGE_DEFAULT

quick test at the console:

import wx
wx.LANGUAGE_DEFAULT

0

i overridden the above line with your suggestion:
wx.LANGUAGE_ENGLISH_US
and now Boa is "normal" again (i.e. all English, all left-to-right),

so the auto-locale question becomes a "python & windows" question, and
not wxpython.

but the letter mirroring is either done by wxpython or wxwidgets, so
who in the wx community that might be interested in this bug?

(and you are correct on boa's updates: latest is from 2011, even
though latest release is 2006)

···

On Oct 18, 12:02 am, Robin Dunn <ro...@alldunn.com> wrote:

On 10/17/11 2:47 PM, shuki wrote:

> actually, it's far worse than i thought

>http://i52.tinypic.com/f56fc1.png

> i didn't know it's even POSSIBLE.
> the actual font inside the text widget is mirrored at the letter
> level! ftw.

That is very weird, probably at least partially due to StyledTextCtrl
not paying any attention at all to the layout direction settings...

> other wxpython programs on my computer works fine (so far...)

Hmmm... So probably something that Boa is doing is triggering this.
BTW, there is probably a newer version of Boa code in their CVS
repository. A snapshot of Boa's code from there is almost always in a
runnable and usable state.

--
Robin Dunn
Software Craftsmanhttp://wxPython.org

That was a nice bug while it lasted. I rather enjoyed the absurdity
of it. Good find.

Che

···

On Mon, Oct 17, 2011 at 6:51 PM, shuki <asafgreenberg@gmail.com> wrote:

thanks.
i worked around the bug.

i can recreate it for you, but i'm not sure it will do on non-hebrew
windows.

you can try, though:
grab Boa constructor from cvs, edit preferences, set the locale to be
hebrew instead of default, and run.
for sure this is the weirdest bug i've ever seen.

···

On Oct 18, 2:29 am, C M <cmpyt...@gmail.com> wrote:

On Mon, Oct 17, 2011 at 6:51 PM, shuki <asafgreenb...@gmail.com> wrote:
> thanks.
> i worked around the bug.

That was a nice bug while it lasted. I rather enjoyed the absurdity
of it. Good find.

Che