Phoenix Aui Notebook Tab Drag Trace

Errors on trying to move the notebook tabs.
Not quite sure what to do with this…
It probably got to do with drawing the tab image or something, Or maybe robin need to hook something in…?

···

Traceback (most recent call last):
File “C:\Python27\lib\site-packages\wx-2.9.5-phoenix\wx\lib\agw\aui\auibook.py”, line 2237, in OnM
otion
self._drag_image.Show()
AttributeError: ‘NoneType’ object has no attribute ‘Show’

Metallicow wrote:

Errors on trying to move the notebook tabs.
Not quite sure what to do with this...
It probably got to do with drawing the tab image or something, Or maybe
robin need to hook something in...?

    Traceback (most recent call last):
    File
    "C:\Python27\lib\site-packages\wx-2.9.5-phoenix\wx\lib\agw\aui\auibook.py",
    line 2237, in OnM
    otion
    self._drag_image.Show()
    AttributeError: 'NoneType' object has no attribute 'Show'

Look at the code and see if you can figure out why self._drag_image is None there. Perhaps some events have happened in a different order, or perhaps an exception happened that caused the code that would have initialized it to be skipped. Track down and fix that issue and this one will likely be fixed too.

···

--
Robin Dunn
Software Craftsman

Still looking/testing… might take a bit of testing…

···

#-----------------------
Also renamed old svn dir and Updated/Dropped wxPython_Phoenix-2.9.5.81-r74486-win32-py2.7
AGW AUI Demo and My SourceCode Editor are giving this Error on startup:
Warning: iCCP: known incorrect sRGB profile.

Search only provided this result, which is unreadable:
C:\Python27\Lib\site-packages\wx-2.9.5-phoenix\wx\wxmsw295u_core_vc90.dll (1 hit)

Any Idea what is causing the Warning.
#-----------------------
Oh and there is a couple wx.VERSION < (2,8): stuff that sneaked back in to the merge in wx/lib/sized_controls.py
and a indentation error that caused startup crash.
IIRC you are not saving anything 2.8, right?

Well I found It finally after littering print statements everywhere.
I commented it out as ##TODO BUG##
Results: AuiNotebookTabDrag split works, but TabDragImage still isn’t showing, but side overlays are when dragging.

wx/lib/agw/aui/auibook.py in def OnMotion

if self._agwFlags & AUI_NB_DRAW_DND_TAB:
# Create the custom draw image from the icons and the text of the item
mouse_tab = self.GetIdxFromWindow(wnd)
page = self._pages[mouse_tab]
tab_button = self._tab_close_buttons[mouse_tab]
self._drag_image = TabDragImage(self, page, tab_button.cur_state, self._art)
print(‘self._drag_image2’, self._drag_image)
if self._agwFlags & AUI_NB_TAB_FLOAT:
print(‘self._drag_image1’, self._drag_image)
self._drag_image.BeginDrag(wx.Point(0,0), self, fullScreen=True)
print(‘self._drag_image11’, self._drag_image)
else:
print(‘self._drag_image2’, self._drag_image)
##TODO BUG## self._drag_image.BeginDrag(wx.Point(0,0), self, self.GetParent())
print(‘self._drag_image22’, self._drag_image)
# Capture the mouse cursor position offset relative to
# The tab image location
self._drag_img_offset = (pos[0] - page.rect.x,
pos[1] - page.rect.y)

                self._drag_image.Show()

Might wx.DragImage.BeginDraw be the problem…and/or possibly need more tweaking?

Metallicow wrote:

Still looking/testing... might take a bit of testing...

#-----------------------
Also renamed old svn dir and Updated/Dropped
wxPython_Phoenix-2.9.5.81-r74486-win32-py2.7
AGW AUI Demo and My SourceCode Editor are giving this Error on startup:
Warning: iCCP: known incorrect sRGB profile.

Search only provided this result, which is unreadable:
C:\Python27\Lib\site-packages\wx-2.9.5-phoenix\wx\wxmsw295u_core_vc90.dll (1
hit)

Any Idea what is causing the Warning.

Google indicates that it is from the new version of libpng, and wxWidgets recently updated the libpng that is being used so that fits. I don't know anything else about it though.

#-----------------------
Oh and there is a couple wx.VERSION < (2,8): stuff that sneaked back in
to the merge in wx/lib/sized_controls.py
and a indentation error that caused startup crash.
IIRC you are not saving anything 2.8, right?

Right, nothing in the Phoenix tree needs to maintain compatibility with 2.8. And unless it is easy to do, I think it's okay for the wx.lib modules to not maintain compatibility with 2.9 Classic either, (although the public APIs should remain compatible.)

···

--
Robin Dunn
Software Craftsman

Metallicow wrote:

Well I found It finally after littering print statements everywhere.
I commented it out as ##TODO BUG##
Results: AuiNotebookTabDrag split works, but TabDragImage still isn't
showing, but side overlays are when dragging.

wx/lib/agw/aui/auibook.py in def OnMotion

    if self._agwFlags & AUI_NB_DRAW_DND_TAB:
    # Create the custom draw image from the icons and the text of the item
    mouse_tab = self.GetIdxFromWindow(wnd)
    page = self._pages[mouse_tab]
    tab_button = self._tab_close_buttons[mouse_tab]
    self._drag_image = TabDragImage(self, page, tab_button.cur_state,
    self._art)
    print('self._drag_image2', self._drag_image)
    if self._agwFlags & AUI_NB_TAB_FLOAT:
    print('self._drag_image1', self._drag_image)
    self._drag_image.BeginDrag(wx.Point(0,0), self, fullScreen=True)
    print('self._drag_image11', self._drag_image)
    else:
    print('self._drag_image2', self._drag_image)
    ##TODO BUG## self._drag_image.BeginDrag(wx.Point(0,0), self,
    self.GetParent())
    print('self._drag_image22', self._drag_image)
    # Capture the mouse cursor position offset relative to
    # The tab image location
    self._drag_img_offset = (pos[0] - page.rect.x,
    pos[1] - page.rect.y)

    self._drag_image.Show()

Might wx.DragImage.BeginDraw be the problem...and/or possibly need more
tweaking?

Was there an exception from BeginDrag?

···

--
Robin Dunn
Software Craftsman

No, but it returns it as a Non or NoneType that specific time the Motion loop runs.
The trace was from the .Show() in the OP.
Maybe the self._drag_image = TabDragImage() is the problem, but it only becomes a Nonetype at the BeginDrag part…what it seems to do anyway…
…Hmmm…?

···

On Wednesday, July 17, 2013 10:00:51 PM UTC-5, Robin Dunn wrote:

Was there an exception from BeginDrag?

Finally figured it out.
Had to resort to using notepad++ to read cryptic file
C:\Python27\Lib\site-packages\wx-2.9.5-phoenix\wx_core.pyd

Came up with a hit.

Simply changed wx.DragImage to wx.GenericDragImage
Not sure why this matters tho…

@Robin: Fixed in the pull REQz.
AUINotebook now seems to be it’s former self, besides the age old split notebook focus bugs.
Maybe wxDragImage still needs some tweaking…?

A Screenie Showing It Working, but the text and Icon on the tab are cutout/showthru/transparent…? The close tab X is fine tho.

http://img832.imageshack.us/img832/8929/v7al.png

Any Ideas… I know with wx29 saving a screenie as .png sorta wrecks the image.
Not sure if this is alpha/screenshot related. The text shouldn’t be tho… hmmm.