Regarding SpinNumCtrl and SpinIntCtrl...

Do you have questions about writing plugins or scripts in Python? Meet the coders here.
Post Reply
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Regarding SpinNumCtrl and SpinIntCtrl...

Post by krambriw » Wed Mar 18, 2009 12:12 pm

I have learned that there could be a problem with the SpinNumCtrl in respect to the locale in the computer

I have tried to search, also looking in the EG API doc, but could not find info about what the groupChar = ' ' has for effect or purpose

Also, besides a couple of SpinNumCtrl I also have some SpinIntCtrl in my plugins. Could they be affected too?

Is this down to a bug ??? I think I remember seeing some other thread related to problems with SpinNumCtrl

Best regards, Walter

User avatar
jinxdone
Plugin Developer
Posts: 443
Joined: Tue Jan 02, 2007 4:08 pm

Re: Regarding SpinNumCtrl and SpinIntCtrl...

Post by jinxdone » Thu Mar 19, 2009 1:51 pm

Hello, I replied to your PM just a minute ago.

Pretty much the thing to know about this is that wxpython expects that groupChar and decimalChar are set to values that are not the same. In eventghost (eg\Classed\SpinNumCtrl.py) there is a piece of code that will set these by default to whatever is in the users locale, this will be different for people in different parts of the world.

Example: if you set only one of the two to some value, like decimalChar = '.' and the user happens to have his locale set so that groupChar also gets set to '.' wxpython will raise an exception.

Fix: If you are going to use either decimalChar or groupChar, make sure you also set the other one to some value even if you don't need it, that way you will avoid the whole issue.

krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Regarding SpinNumCtrl and SpinIntCtrl...

Post by krambriw » Thu Mar 19, 2009 4:24 pm

Thank you very much,
Best regards, Walter

Post Reply