abulka/pynsource

Running pynsource under python 3.10 needs ints not floats to all OGL calls

abulka opened this issue · 1 comments

I've fixed most of these, but here is another.

Traceback (most recent call last):
  File "/Users/andy/Devel/pynsource/src/gui/repair_ogl.py", line 107, in new_OnMouseEvent
    old_OnMouseEvent(self, event)
  File "/Users/andy/Devel/pynsource/venv310/lib/python3.10/site-packages/wx/lib/ogl/canvas.py", line 321, in OnMouseEvent
    self.Draw()
  File "/Users/andy/Devel/pynsource/venv310/lib/python3.10/site-packages/wx/lib/ogl/canvas.py", line 101, in Draw
    self.GetDiagram().Redraw(dc)
  File "/Users/andy/Devel/pynsource/venv310/lib/python3.10/site-packages/wx/lib/ogl/diagram.py", line 42, in Redraw
    object.Draw(dc)
  File "/Users/andy/Devel/pynsource/venv310/lib/python3.10/site-packages/wx/lib/ogl/basic.py", line 1436, in Draw
    self.GetEventHandler().OnDraw(dc)
  File "/Users/andy/Devel/pynsource/venv310/lib/python3.10/site-packages/wx/lib/ogl/basic.py", line 154, in OnDraw
    self._previousHandler.OnDraw(dc)
  File "/Users/andy/Devel/pynsource/venv310/lib/python3.10/site-packages/wx/lib/ogl/divided.py", line 181, in OnDraw
    RectangleShape.OnDraw(self, dc)
  File "/Users/andy/Devel/pynsource/venv310/lib/python3.10/site-packages/wx/lib/ogl/basic.py", line 2774, in OnDraw
    dc.DrawRectangle(int(x1), int(y1), self._width, self._height)
TypeError: DC.DrawRectangle(): arguments did not match any overloaded call:
  overload 1: argument 3 has unexpected type 'float'
  overload 2: argument 1 has unexpected type 'int'
  overload 3: argument 1 has unexpected type 'int'

Looks like a problem with the wxPython OGL module - see wxWidgets/Phoenix#2349.

May have to work around this by bundling a local copy of OGL.py with the required float to int fixes.