I am seeing this exception with some code ported from wxp2/3 to wxp4:
2019-07-02 12:13:58 DEBUG gm.gui [3081825984 MainThread] (/home/ncq/Projekte/gm/git/gnumed/gnumed/Gnumed/wxpython/gmExceptionHandlingWidgets.py::handle_uncaught_exception_wx() #198): unhandled exception caught:
Traceback (most recent call last):
File "/home/ncq/Projekte/gm/git/gnumed/gnumed/Gnumed/wxpython/gmTextCtrl.py", line 386, in _on_expando_needs_layout
y_view = self.ViewStart[1]
AttributeError: 'cProgressNotesEAPnl' object has no attribute 'ViewStart'
The cProgressNotesEAPnl is a child of wx.ScrolledWindow and
uses .ViewStart to scroll into view the line with the cursor
of an (expando) text ctrl contained within the panel:
def _on_expando_needs_layout(self, evt):
# need to tell ourselves to re-Layout to refresh scroll bars
# provoke adding scrollbar if needed
#self.Fit() # works on Linux but not on Windows
self.FitInside() # needed on Windows rather than self.Fit()
if self.HasScrollbar(wx.VERTICAL):
# scroll panel to show cursor
expando = self.FindWindowById(evt.GetId())
y_expando = expando.GetPositionTuple()[1]
h_expando = expando.GetSize()[1]
line_of_cursor = expando.PositionToXY(expando.GetInsertionPoint())[2] + 1
if expando.NumberOfLines == 0:
no_of_lines = 1
else:
no_of_lines = expando.NumberOfLines
y_cursor = int(round((float(line_of_cursor) / no_of_lines) * h_expando))
y_desired_visible = y_expando + y_cursor
···
###############################
# failing call:
###############################
y_view = self.ViewStart[1]
h_view = self.GetClientSize()[1]
# expando starts before view
if y_desired_visible < y_view:
self.Scroll(0, y_desired_visible)
if y_desired_visible > h_view:
self.Scroll(0, y_desired_visible)
which fails, due to the .ViewStart property not available anymore.
I have not been able to derive from documentation what I
should use instead.
Thanks for any suggestions,
Karsten
--
GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B