On python 3.12.4 with wxPython 4.2.2, when I execute the demo for the ogl library and resize any of the rectangle shapes I get the following :
Traceback (most recent call last):
File "/Users/humberto.a.sanchez.ii/Documents/Developer/wxPython-demo-4.2.2/pyenv-3.12.4/lib/python3.12/site-packages/wx/lib/ogl/canvas.py", line 321, in OnMouseEvent
self.Draw()
File "/Users/humberto.a.sanchez.ii/Documents/Developer/wxPython-demo-4.2.2/pyenv-3.12.4/lib/python3.12/site-packages/wx/lib/ogl/canvas.py", line 101, in Draw
self.GetDiagram().Redraw(dc)
File "/Users/humberto.a.sanchez.ii/Documents/Developer/wxPython-demo-4.2.2/pyenv-3.12.4/lib/python3.12/site-packages/wx/lib/ogl/diagram.py", line 42, in Redraw
object.Draw(dc)
File "/Users/humberto.a.sanchez.ii/Documents/Developer/wxPython-demo-4.2.2/pyenv-3.12.4/lib/python3.12/site-packages/wx/lib/ogl/basic.py", line 1436, in Draw
self.GetEventHandler().OnDraw(dc)
File "/Users/humberto.a.sanchez.ii/Documents/Developer/wxPython-demo-4.2.2/pyenv-3.12.4/lib/python3.12/site-packages/wx/lib/ogl/basic.py", line 154, in OnDraw
self._previousHandler.OnDraw(dc)
File "/Users/humberto.a.sanchez.ii/Documents/Developer/wxPython-demo-4.2.2/pyenv-3.12.4/lib/python3.12/site-packages/wx/lib/ogl/divided.py", line 181, in OnDraw
RectangleShape.OnDraw(self, dc)
File "/Users/humberto.a.sanchez.ii/Documents/Developer/wxPython-demo-4.2.2/pyenv-3.12.4/lib/python3.12/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 some computations are using just ‘/’ instead of ‘//’ to coerce everything to an integer
Traceback (most recent call last):
File "/Users/humberto.a.sanchez.ii/Documents/Developer/wxPython-demo-4.2.3/pyenv-3.12.9/lib/python3.12/site-packages/wx/lib/ogl/canvas.py", line 321, in OnMouseEvent
self.Draw()
File "/Users/humberto.a.sanchez.ii/Documents/Developer/wxPython-demo-4.2.3/pyenv-3.12.9/lib/python3.12/site-packages/wx/lib/ogl/canvas.py", line 101, in Draw
self.GetDiagram().Redraw(dc)
File "/Users/humberto.a.sanchez.ii/Documents/Developer/wxPython-demo-4.2.3/pyenv-3.12.9/lib/python3.12/site-packages/wx/lib/ogl/diagram.py", line 42, in Redraw
object.Draw(dc)
File "/Users/humberto.a.sanchez.ii/Documents/Developer/wxPython-demo-4.2.3/pyenv-3.12.9/lib/python3.12/site-packages/wx/lib/ogl/basic.py", line 1436, in Draw
self.GetEventHandler().OnDraw(dc)
File "/Users/humberto.a.sanchez.ii/Documents/Developer/wxPython-demo-4.2.3/pyenv-3.12.9/lib/python3.12/site-packages/wx/lib/ogl/basic.py", line 154, in OnDraw
self._previousHandler.OnDraw(dc)
File "/Users/humberto.a.sanchez.ii/Documents/Developer/wxPython-demo-4.2.3/pyenv-3.12.9/lib/python3.12/site-packages/wx/lib/ogl/basic.py", line 3447, in OnDraw
dc.DrawEllipse(int(self._xpos - self.GetWidth() / 2.0), int(self._ypos - self.GetHeight() / 2.0), self.GetWidth(), self.GetHeight())
TypeError: DC.DrawEllipse(): 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'
Unfortunately, I have no idea how to build wxPython from scratch to validate any of my fixes. I have tried looking at the instructions, but they seem dated
self.SetDrawnBackgroundColour(UmlUtils.backGroundBrush())
File "/Users/humberto.a.sanchez.ii/PycharmProjects/umlshapes/pyenv-3.12.9/lib/python3.12/site-packages/wx/lib/ogl/drawn.py", line 850, in SetDrawnBackgroundColour
self._metafiles[self._currentAngle].SetBackgroundColour(colour)
File "/Users/humberto.a.sanchez.ii/PycharmProjects/umlshapes/pyenv-3.12.9/lib/python3.12/site-packages/wx/lib/ogl/drawn.py", line 614, in SetBackgroundColour
op._r, op._g, op._b = colour.Red(), colour.Green(), colour.Blue()
^^^^^^^^^^
AttributeError: 'Brush' object has no attribute 'Red'. Did you mean: 'Ref'?
It looks like the problems you’re seeing are all in pure Python files, so you can just modify them in place in your virtualenv to test your changes (there is no need to build anything).
If you really want to build wxPython though, the instructions are in the repository in the README.
GraphQL: Your token has not been granted the required scopes to execute this query. The 'filename' field requires one of the following scopes: ['repo'], but your token has only been granted the: ['project', 'public_repo', 'read:user', 'repo:status'] scopes. Please modify your token's scopes at: https://github.com/settings/tokens., Your token has not been granted the required scopes to execute this query. The 'body' field requires one of the following scopes: ['repo'], but your token has only been granted the: ['project', 'public_repo', 'read:user', 'repo:status'] scopes. Please modify your token's scopes at: https://github.com/settings/tokens.