belangeo / pyo

Python DSP module
GNU Lesser General Public License v3.0
1.31k stars 131 forks source link

Wxpython 4.2.0 #251

Closed Manu197-pn closed 1 year ago

Manu197-pn commented 2 years ago

I am using WXpython 4.2 , the Scope provide an error but the program is working. The error appears each time the scope box is resized. I read that pyo support Wxpython 4.0.7 but I do not succeed in going back to this release. ( Mac OS 12.6 ) Is it still the case or 4.2 is now supported ?

Traceback (most recent call last): File "/Users/emmanuel/PycharmProjects/pythonProject2/venv/lib/python3.10/site-packages/pyo/lib/_wxwidgets.py", line 429, in OnPaint rec = wx.Rect(0, self.pos - self.knobHalfSize, w, self.knobSize - 1) TypeError: Rect(): arguments did not match any overloaded call: overload 1: too many arguments overload 2: argument 2 has unexpected type 'float' overload 3: argument 1 has unexpected type 'int' overload 4: argument 1 has unexpected type 'int' overload 5: argument 1 has unexpected type 'int' overload 6: argument 1 has unexpected type 'int'

belangeo commented 1 year ago

All good here on linux with wxpython 4.2, I still need to confirm on Mac and Windows...

Bibiko commented 1 year ago

On macOS 13.1 (arm) and on macOS 12.4 (intel) the issue is that self.pos is a float (coming via self.scale and tFromValue), but all arguments to init a wx.Rect have to be integers [lines 331, 334, 427, 435 in lib/_wxwidgets.py]. I do not know whether a int(self.pos) or round(self.pos) would be the right way here.

belangeo commented 1 year ago

I don't get the same behaviour on linux or Windows :( I'll fix this everywhere when I'll test on MacOS (linux and Windows are almost ready for the release).

belangeo commented 1 year ago

Pretty much safe change... Up in master.

Bibiko commented 1 year ago

I built it and it works - thanks!