Was working with the AuiNotebook a little and ran into the following issue. It is reproducible in the demo as well but couldn't get the traceback when doing there for some reason.
1) Split the notebook by dragging one of the tabs to a dockable location in the notebook
2) Double click on the sash
Traceback (most recent call last):
File "/Users/codyprecord/Desktop/devel/Editra/src/extern/aui/framemanager.py", line 8383, in OnRender
art.DrawBorder(dc, self._frame, part.rect, part.pane)
File "/Users/codyprecord/Desktop/devel/Editra/src/extern/aui/dockart.py", line 462, in DrawBorder
dc.DrawRectangle(drect.x, drect.y, drect.width, drect.height)
File "//usr/local/lib/wxPython-unicode-2.8.10.1/lib/python2.6/site-packages/wx-2.8-mac-unicode/wx/_gdi.py", line 3218, in DrawRectangle
return _gdi_.DC_DrawRectangle(*args, **kwargs)
PyAssertionError: C++ assertion "status == noErr" failed at /BUILD/wxPython-src-2.8.10.1/src/mac/carbon/graphics.cpp(1425) in EnsureIsValid(): Cannot nest wxDCs on the same window
Just FYI, it will probably be working okay on Windows, the prohibition against nesting DCs is a Mac-only thing, so it may be tricky for you to track down. It usually happens when you have some drawing code that calls another function before it is finished, and that other function tries to create a new DC while the one in the original function still exists.
···
On 1/28/10 4:56 PM, Cody Precord wrote:
Hi Andrea,
Was working with the AuiNotebook a little and ran into the following
issue. It is reproducible in the demo as well but couldn't get the
traceback when doing there for some reason.
1) Split the notebook by dragging one of the tabs to a dockable location
in the notebook
2) Double click on the sash
Traceback (most recent call last):
File
"/Users/codyprecord/Desktop/devel/Editra/src/extern/aui/framemanager.py", line
8383, in OnRender
art.DrawBorder(dc, self._frame, part.rect, part.pane)
File
"/Users/codyprecord/Desktop/devel/Editra/src/extern/aui/dockart.py",
line 462, in DrawBorder
dc.DrawRectangle(drect.x, drect.y, drect.width, drect.height)
File
"//usr/local/lib/wxPython-unicode-2.8.10.1/lib/python2.6/site-packages/wx-2.8-mac-unicode/wx/_gdi.py",
line 3218, in DrawRectangle
return _gdi_.DC_DrawRectangle(*args, **kwargs)
PyAssertionError: C++ assertion "status == noErr" failed at
/BUILD/wxPython-src-2.8.10.1/src/mac/carbon/graphics.cpp(1425) in
EnsureIsValid(): Cannot nest wxDCs on the same window
Was working with the AuiNotebook a little and ran into the following
issue. It is reproducible in the demo as well but couldn't get the
traceback when doing there for some reason.
1) Split the notebook by dragging one of the tabs to a dockable location
in the notebook
2) Double click on the sash
Traceback (most recent call last):
File
"/Users/codyprecord/Desktop/devel/Editra/src/extern/aui/framemanager.py", line
8383, in OnRender
art.DrawBorder(dc, self._frame, part.rect, part.pane)
File
"/Users/codyprecord/Desktop/devel/Editra/src/extern/aui/dockart.py",
line 462, in DrawBorder
dc.DrawRectangle(drect.x, drect.y, drect.width, drect.height)
File
"//usr/local/lib/wxPython-unicode-2.8.10.1/lib/python2.6/site-packages/wx-2.8-mac-unicode/wx/_gdi.py",
line 3218, in DrawRectangle
return _gdi_.DC_DrawRectangle(*args, **kwargs)
PyAssertionError: C++ assertion "status == noErr" failed at
/BUILD/wxPython-src-2.8.10.1/src/mac/carbon/graphics.cpp(1425) in
EnsureIsValid(): Cannot nest wxDCs on the same window
Just FYI, it will probably be working okay on Windows, the prohibition against nesting DCs is a Mac-only thing, so it may be tricky for you to track down. It usually happens when you have some drawing code that calls another function before it is finished, and that other function tries to create a new DC while the one in the original function still exists.
I traced into it some and it is caused by creating a ClientDC inside of the Repaint method of the frame manager.
if dc is None:
client_dc = wx.ClientDC(self._frame)
dc = client_dc
Think it would be possible to get rid of the ClientDC and do everything inside of OnPaint?
Was working with the AuiNotebook a little and ran into the following
issue. It is reproducible in the demo as well but couldn't get the
traceback when doing there for some reason.
1) Split the notebook by dragging one of the tabs to a dockable location
in the notebook
2) Double click on the sash
Traceback (most recent call last):
File
"/Users/codyprecord/Desktop/devel/Editra/src/extern/aui/framemanager.py",
line
8383, in OnRender
art.DrawBorder(dc, self._frame, part.rect, part.pane)
File
"/Users/codyprecord/Desktop/devel/Editra/src/extern/aui/dockart.py",
line 462, in DrawBorder
dc.DrawRectangle(drect.x, drect.y, drect.width, drect.height)
File
"//usr/local/lib/wxPython-unicode-2.8.10.1/lib/python2.6/site-packages/wx-2.8-mac-unicode/wx/_gdi.py",
line 3218, in DrawRectangle
return _gdi_.DC_DrawRectangle(*args, **kwargs)
PyAssertionError: C++ assertion "status == noErr" failed at
/BUILD/wxPython-src-2.8.10.1/src/mac/carbon/graphics.cpp(1425) in
EnsureIsValid(): Cannot nest wxDCs on the same window
Just FYI, it will probably be working okay on Windows, the prohibition
against nesting DCs is a Mac-only thing, so it may be tricky for you to
track down. It usually happens when you have some drawing code that calls
another function before it is finished, and that other function tries to
create a new DC while the one in the original function still exists.
I traced into it some and it is caused by creating a ClientDC inside of the
Repaint method of the frame manager.
if dc is None:
client_dc = wx.ClientDC(self._frame)
dc = client_dc
Think it would be possible to get rid of the ClientDC and do everything
inside of OnPaint?
I think this issue should be fixed by the latest SVN change I made. I
did it a bit differently but hopefully it will still work on the Mac.
Please let me know if this is not the case.
Think it would be possible to get rid of the ClientDC and do everything
inside of OnPaint?
I think this issue should be fixed by the latest SVN change I made. I
did it a bit differently but hopefully it will still work on the Mac.
Please let me know if this is not the case.
Thanks, I will retest this evening and find out.
Two more small areas for improvements that I noticed while working
with the control this weekend.
1) If you click down on a tab close button and then start dragging the
mouse, it should not start dragging the tab. It should instead just be
a way to cancel clicking on the button.
2) The method used for showing the pressed state of the close buttons
by offsetting the image by 1 pixel is not as nice as giving the affect
by changing the shading on the button. It would be better to have a
third image for the pressed state instead of doing just offsetting the
highlighted button. For example the mac close button would be better
drawn by darkening the background and shading the 'X' portion in a
slightly darker color. Something similar would also work for the other
platforms buttons. If you look at native controls most/all of them do
something like this instead of offsetting the image.
Thanks,
Cody
···
On Mon, Feb 1, 2010 at 9:36 AM, Andrea Gavana <andrea.gavana@gmail.com> wrote:
Was working with the AuiNotebook a little and ran into the following
issue. It is reproducible in the demo as well but couldn't get the
traceback when doing there for some reason.
1) Split the notebook by dragging one of the tabs to a dockable location
in the notebook
2) Double click on the sash
Traceback (most recent call last):
File
"/Users/codyprecord/Desktop/devel/Editra/src/extern/aui/framemanager.py",
line
8383, in OnRender
art.DrawBorder(dc, self._frame, part.rect, part.pane)
File
"/Users/codyprecord/Desktop/devel/Editra/src/extern/aui/dockart.py",
line 462, in DrawBorder
dc.DrawRectangle(drect.x, drect.y, drect.width, drect.height)
File
"//usr/local/lib/wxPython-unicode-2.8.10.1/lib/python2.6/site-packages/wx-2.8-mac-unicode/wx/_gdi.py",
line 3218, in DrawRectangle
return _gdi_.DC_DrawRectangle(*args, **kwargs)
PyAssertionError: C++ assertion "status == noErr" failed at
/BUILD/wxPython-src-2.8.10.1/src/mac/carbon/graphics.cpp(1425) in
EnsureIsValid(): Cannot nest wxDCs on the same window
Just FYI, it will probably be working okay on Windows, the prohibition
against nesting DCs is a Mac-only thing, so it may be tricky for you to
track down. It usually happens when you have some drawing code that calls
another function before it is finished, and that other function tries to
create a new DC while the one in the original function still exists.
I traced into it some and it is caused by creating a ClientDC inside of the
Repaint method of the frame manager.
if dc is None:
client_dc = wx.ClientDC(self._frame)
dc = client_dc
Think it would be possible to get rid of the ClientDC and do everything
inside of OnPaint?
I think this issue should be fixed by the latest SVN change I made. I
did it a bit differently but hopefully it will still work on the Mac.
Please let me know if this is not the case.
That does stop the crash from happening but unfortunately the screen is not correctly redrawn when trying to unsplit a notebook by double clicking on the sash.
1) Double click on notebook sash
2) The sash stays there but there is a partial overlay (the meshy looking sash drag shadow) gets drawn towards the right hand side of the screen.
Also noticed that it appears to be unecessary to set the AUI_NB_SASH_DCLICK_UNSPLIT style in order to enable the double click on sash to unsplit option as it always seems to be enabled.
Was working with the AuiNotebook a little and ran into the following
issue. It is reproducible in the demo as well but couldn't get the
traceback when doing there for some reason.
1) Split the notebook by dragging one of the tabs to a dockable
location
in the notebook
2) Double click on the sash
Traceback (most recent call last):
File
"/Users/codyprecord/Desktop/devel/Editra/src/extern/aui/framemanager.py",
line
8383, in OnRender
art.DrawBorder(dc, self._frame, part.rect, part.pane)
File
"/Users/codyprecord/Desktop/devel/Editra/src/extern/aui/dockart.py",
line 462, in DrawBorder
dc.DrawRectangle(drect.x, drect.y, drect.width, drect.height)
File
"//usr/local/lib/wxPython-unicode-2.8.10.1/lib/python2.6/site-packages/wx-2.8-mac-unicode/wx/_gdi.py",
line 3218, in DrawRectangle
return _gdi_.DC_DrawRectangle(*args, **kwargs)
PyAssertionError: C++ assertion "status == noErr" failed at
/BUILD/wxPython-src-2.8.10.1/src/mac/carbon/graphics.cpp(1425) in
EnsureIsValid(): Cannot nest wxDCs on the same window
Just FYI, it will probably be working okay on Windows, the prohibition
against nesting DCs is a Mac-only thing, so it may be tricky for you to
track down. It usually happens when you have some drawing code that
calls
another function before it is finished, and that other function tries to
create a new DC while the one in the original function still exists.
I traced into it some and it is caused by creating a ClientDC inside of
the
Repaint method of the frame manager.
if dc is None:
client_dc = wx.ClientDC(self._frame)
dc = client_dc
Think it would be possible to get rid of the ClientDC and do everything
inside of OnPaint?
I think this issue should be fixed by the latest SVN change I made. I
did it a bit differently but hopefully it will still work on the Mac.
Please let me know if this is not the case.
That does stop the crash from happening but unfortunately the screen is not
correctly redrawn when trying to unsplit a notebook by double clicking on
the sash.
Then I don't understand where the crash is happening. This is what I
am doing now:
if wx.Platform == "__WXMAC__":
self._frame.Refresh()
else:
self.Repaint()
for every instance of Repaint() I had before. There shouldn't be any
call to wx.ClientDC on the Mac, as the Refresh triggers the OnPaint
event on the Mac.
1) Double click on notebook sash
2) The sash stays there but there is a partial overlay (the meshy looking
sash drag shadow) gets drawn towards the right hand side of the screen.
Also noticed that it appears to be unecessary to set the
AUI_NB_SASH_DCLICK_UNSPLIT style in order to enable the double click on sash
to unsplit option as it always seems to be enabled.
I believe this is happening because AUI_NB_SASH_DCLICK_UNSPLIT
interferes with the wxWidgets windows style:
AUI_NB_SASH_DCLICK_UNSPLIT = 1 << 22
The solution to this should be to remove the style and use a method
(something like SetDClickUnsplit) for AuiNotebook. I'll implement it
in that way. As I understand from your post, it seems like I should
revert back the changes made to framemanager yesterday.
I think this issue should be fixed by the latest SVN change I made. I
did it a bit differently but hopefully it will still work on the Mac.
Please let me know if this is not the case.
That does stop the crash from happening but unfortunately the screen is not
correctly redrawn when trying to unsplit a notebook by double clicking on
the sash.
Then I don't understand where the crash is happening. This is what I
am doing now:
if wx.Platform == "__WXMAC__":
self._frame.Refresh()
else:
self.Repaint()
for every instance of Repaint() I had before. There shouldn't be any
call to wx.ClientDC on the Mac, as the Refresh triggers the OnPaint
event on the Mac.
No your change was fine, it _does_ fix the crash. Its just that the issue now is that the notebooks don' t unsplit when double clicking on the sash so maybe there is something that happens in the Repaint path when it is called outside an OnPaint event that is not happening now?
I think this issue should be fixed by the latest SVN change I made. I
did it a bit differently but hopefully it will still work on the Mac.
Please let me know if this is not the case.
That does stop the crash from happening but unfortunately the screen is
not
correctly redrawn when trying to unsplit a notebook by double clicking on
the sash.
Then I don't understand where the crash is happening. This is what I
am doing now:
if wx.Platform == "__WXMAC__":
self._frame.Refresh()
else:
self.Repaint()
for every instance of Repaint() I had before. There shouldn't be any
call to wx.ClientDC on the Mac, as the Refresh triggers the OnPaint
event on the Mac.
No your change was fine, it _does_ fix the crash.
Sorry, I didn't get my morning coffee when I answered your question
Its just that the issue
now is that the notebooks don' t unsplit when double clicking on the sash so
maybe there is something that happens in the Repaint path when it is called
outside an OnPaint event that is not happening now?
It seems a bit strange to me, as the OnPaint handler is simply this:
def OnPaint(self, event):
dc = wx.PaintDC(self._frame)
self.Repaint(dc)
And the Repaint method itself, when called outside an OnPaint event,
simply checks if the dc exists:
if dc is None:
client_dc = wx.ClientDC(self._frame)
dc = client_dc
It seems a bit strange to me, as the OnPaint handler is simply this:
def OnPaint(self, event):
dc = wx.PaintDC(self._frame)
self.Repaint(dc)
And the Repaint method itself, when called outside an OnPaint event,
simply checks if the dc exists:
if dc is None:
client_dc = wx.ClientDC(self._frame)
dc = client_dc
I can't see what I am doing wrong at the moment
Strange indeed. Will hopefully have some extra time later this week to
try and look into it more. Since the error previously was about the
DC's being nested it would seem that perhaps another paint event is
already in motion or queued up that may be resetting the state or
something along those lines. Anyway this is all just a guess until I
get a chance to do more debugging.
Also can't remember if I sent this yesterday or not but there is a bug
with clicking on a tabs close button. If you click and hold down on
the close button and then drag the mouse away without releasing the
button it starts dragging the tab out of the notebook. I would expect
that doing this would not drag the tab.
Thanks,
Cody
···
On Tue, Feb 2, 2010 at 7:15 AM, Andrea Gavana <andrea.gavana@gmail.com> wrote:
On Tue, Feb 2, 2010 at 7:15 AM, Andrea Gavana <andrea.gavana@gmail.com> wrote:
Hi Cody,
It seems a bit strange to me, as the OnPaint handler is simply this:
def OnPaint(self, event):
dc = wx.PaintDC(self._frame)
self.Repaint(dc)
And the Repaint method itself, when called outside an OnPaint event,
simply checks if the dc exists:
if dc is None:
client_dc = wx.ClientDC(self._frame)
dc = client_dc
I can't see what I am doing wrong at the moment
Strange indeed. Will hopefully have some extra time later this week to
try and look into it more. Since the error previously was about the
DC's being nested it would seem that perhaps another paint event is
already in motion or queued up that may be resetting the state or
something along those lines. Anyway this is all just a guess until I
get a chance to do more debugging.
Also can't remember if I sent this yesterday or not but there is a bug
with clicking on a tabs close button. If you click and hold down on
the close button and then drag the mouse away without releasing the
button it starts dragging the tab out of the notebook. I would expect
that doing this would not drag the tab.
Yes, you did mention it, it's just that I didn't have time to fix it yet