reproducible crash with Python AUI, checkout today 20090421

Dear Andrea,

Today I was testing the latest checkout of your Python AUI code on
Windows XP with wxPython 2.8.9.2 / Python 2.5.2. I came across the
following reproducible crash with the AUI.py demo:

1. Select Perspectives | All Panes from the menu
2. drag the client size reporter (second from right, second row of
windows from the top) and drop on pane caption window top right so it
forms a tab.
3. now drag the client size reporter tab away and dock at the top of
"Welcome to AUI" window.

This yields to the an "Unhandled exception" dialog and application
termination. Is this information sufficient for reproduction?

Thanks,
Charl

Charl Botha wrote:


Dear Andrea,
Today I was testing the latest checkout of your Python AUI code on
Windows XP with wxPython 2.8.9.2 / Python 2.5.2. I came across the
following reproducible crash with the AUI.py demo:
1. Select Perspectives | All Panes from the menu
2. drag the client size reporter (second from right, second row of
windows from the top) and drop on pane caption window top right so it
forms a tab.
3. now drag the client size reporter tab away and dock at the top of
"Welcome to AUI" window.
This yields to the an "Unhandled exception" dialog and application
termination. Is this information sufficient for reproduction?

Just checked out ref 60266 on Vista with Python 2.5.4 and wxPython
2.8.9.1 Unicode.

I see the same. Actually taking just about any window and docking it
as a notebook to another window and then undocking it causes an
exception.

I also sometimes get this - but can not give you steps - at least not
yet.

Werner

Hi Charl, Werner & All,

Dear Andrea,

Today I was testing the latest checkout of your Python AUI code on
Windows XP with wxPython 2.8.9.2 / Python 2.5.2. I came across the
following reproducible crash with the AUI.py demo:

1. Select Perspectives | All Panes from the menu
2. drag the client size reporter (second from right, second row of
windows from the top) and drop on pane caption window top right so it
forms a tab.
3. now drag the client size reporter tab away and dock at the top of
"Welcome to AUI" window.

This yields to the an "Unhandled exception" dialog and application
termination. Is this information sufficient for reproduction?

Yes, it is: I get exactly the same error dialog (and also with the
steps montioned by Werner in the next message). I think I have found
the reason of the misbehaviour, can you please try to update your SVN
copy and let me know if it works?

The bug was related on the style of automatic AuiNotebooks: I have
exceeded the number of style I can use before interfering with
wxWindow styles, so the style AUI_NB_DRAW_DND_TAB has actually the
value of wx.CLIP_CHILDREN, which shouldn't happen. Now, which is the
best practice to implement when the styles are too many? Using extra
styles as wx.Window does?

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

···

On Tue, Apr 21, 2009 at 12:27 PM, Charl Botha wrote:

Andrea Gavana wrote:

Hi Charl, Werner & All,

Dear Andrea,

Today I was testing the latest checkout of your Python AUI code on
Windows XP with wxPython 2.8.9.2 / Python 2.5.2. I came across the
following reproducible crash with the AUI.py demo:

1. Select Perspectives | All Panes from the menu
2. drag the client size reporter (second from right, second row of
windows from the top) and drop on pane caption window top right so it
forms a tab.
3. now drag the client size reporter tab away and dock at the top of
"Welcome to AUI" window.

This yields to the an "Unhandled exception" dialog and application
termination. Is this information sufficient for reproduction?
    
Yes, it is: I get exactly the same error dialog (and also with the
steps montioned by Werner in the next message). I think I have found
the reason of the misbehaviour, can you please try to update your SVN
copy and let me know if it works?
  

Yeap, works fine for me.

Werner

···

On Tue, Apr 21, 2009 at 12:27 PM, Charl Botha wrote:

Hello,

The bug was related on the style of automatic AuiNotebooks: I have

exceeded the number of style I can use before interfering with

wxWindow styles, so the style AUI_NB_DRAW_DND_TAB has actually the

value of wx.CLIP_CHILDREN, which shouldn’t happen. Now, which is the

best practice to implement when the styles are too many? Using extra

styles as wx.Window does?

I would say its a matter of preference, but I would look at the current style flags and sort out the ones that would probably not be very commonly used in a bare non subclassed version of the control and move them to being properties that can be set on or off.

For the AUI_NB flags for example it might make sense to move the following to be properties as they are closer to ‘behavior’ flags than ‘style’ in the sense of how the control is displayed.

AUI_NB_SASH_DCLICK_UNSPLIT
AUI_NB_TAB_FLOAT
AUI_NB_MIDDLE_CLICK_CLOSE
AUI_NB_TAB_SPLIT
AUI_NB_TAB_MOVE
AUI_NB_TAB_EXTERNAL_MOVE
AUI_NB_HIDE_ON_SINGLE_TAB
AUI_NB_SMART_TABS

For the ones of these that are part of the DEFAULT_STYLE they could just simply default to True.

Another option would be to not pass the style param down to the wxWindow (or wxWindow derived) classes init method then the conflict could not happen. It also arguably doesn’t make sense to do this anyways, outside of trying to support some of the generic wxWIndow flags like BORDER_* that would be used by the base window class or PyControl in the instance onf the Notebook.

Cody

···

On Tue, Apr 21, 2009 at 8:14 AM, Andrea Gavana andrea.gavana@gmail.com wrote:

Wow cool!

I've not been able to make it crash again. :slight_smile:

See you,
Charl

···

2009/4/21 Andrea Gavana <andrea.gavana@gmail.com>:

On Tue, Apr 21, 2009 at 12:27 PM, Charl Botha wrote:

3. now drag the client size reporter tab away and dock at the top of
"Welcome to AUI" window.

This yields to the an "Unhandled exception" dialog and application
termination. Is this information sufficient for reproduction?

Yes, it is: I get exactly the same error dialog (and also with the
steps montioned by Werner in the next message). I think I have found
the reason of the misbehaviour, can you please try to update your SVN
copy and let me know if it works?

Cody Precord wrote:

Hello,

    The bug was related on the style of automatic AuiNotebooks: I have
    exceeded the number of style I can use before interfering with
    wxWindow styles, so the style AUI_NB_DRAW_DND_TAB has actually the
    value of wx.CLIP_CHILDREN, which shouldn't happen. Now, which is the
    best practice to implement when the styles are too many? Using extra
    styles as wx.Window does?

I would say its a matter of preference, but I would look at the current style flags and sort out the ones that would probably not be very commonly used in a bare non subclassed version of the control and move them to being properties that can be set on or off.

Agreed. Things that are visual could be kept as styles, and others can be handled with setters and getters. If you want to be able to still set them in the call to __init__ then you can add additional keyword parameters that set those properties.

Another option would be to not pass the style param down to the wxWindow (or wxWindow derived) classes __init__ method then the conflict could not happen. It also arguably doesn't make sense to do this anyways, outside of trying to support some of the generic wxWIndow flags like BORDER_* that would be used by the base window class or PyControl in the instance onf the Notebook.

I think this is a bad idea. The wx style bits that are common to all windows are expected to be passed to the real window, and I think you are just asking for trouble down the road if you ignore them. Even if you do that it still only gives you an additional 16 styles so it is possible to still run out of space in the future.

···

On Tue, Apr 21, 2009 at 8:14 AM, Andrea Gavana <andrea.gavana@gmail.com > <mailto:andrea.gavana@gmail.com>> wrote:

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Hi All,

Cody Precord wrote:

Hello,

The bug was related on the style of automatic AuiNotebooks: I have
exceeded the number of style I can use before interfering with
wxWindow styles, so the style AUI_NB_DRAW_DND_TAB has actually the
value of wx.CLIP_CHILDREN, which shouldn't happen. Now, which is the
best practice to implement when the styles are too many? Using extra
styles as wx.Window does?

I would say its a matter of preference, but I would look at the current
style flags and sort out the ones that would probably not be very commonly
used in a bare non subclassed version of the control and move them to being
properties that can be set on or off.

Agreed. Things that are visual could be kept as styles, and others can be
handled with setters and getters. If you want to be able to still set them
in the call to __init__ then you can add additional keyword parameters that
set those properties.

The usefulness of having everything in a single "style" keyword is,
apart of being able to write:

AuiNotebook.__init__(self, parent, style=AUI_STYLES|wxWINDOW_STYLES)

that the "style" keyword is passed directly to the tab rendering
engines (AuiTabArt), without messing up with other properties. The
AuiTabArt knows only about this "style" keyword and nothing else, and
this keyword contains all the information needed to properly draw a
tab. If I have to use properties for some of the flags, I need either
to pass a bunch of properties to the tab rendering engine like this:

self.SetArtProvider(AuiTabArt(flags, property1, property2, property3,
..., propertyN))

Or to pass a reference of the AuiNotebook to the AuiTabArt. This is
somehow cumbersome and not consistent with what AuiDockArt (the
rendering engine for AuiManager) does. AuiDockArt knows only about the
"style". So, I believe I am going to split window styles and AUI
styles in 2 keywords, so that the __init__ method of AuiNotebook can
be written like this:

def __init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition,
size=wx.DefaultSize,
                 aui_style=AUI_NB_DEFAULT_STYLE, win_style=0)

I know it might break someone else's code (although the only person I
know that is using (?) AUI is Werner) and I also know it will not be
interchangeable with wx.aui.AuiNotebook. Unless someone can come up
with a better solution...

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

···

On Tue, Apr 21, 2009 at 9:35 PM, Robin Dunn wrote:

On Tue, Apr 21, 2009 at 8:14 AM, Andrea Gavana <andrea.gavana@gmail.com >> <mailto:andrea.gavana@gmail.com>> wrote:

Hi All,

It's a bit OT, but it looks like we are going to have some nice
enhancements of wx.aui in wxWidgets:

http://lists.wxwidgets.org/pipermail/wx-dev/2009-April/113902.html

I hope I am not going to abandon PyAUI for the second time... :smiley:

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

Andrea Gavana wrote:

Hi All,
  

...

Or to pass a reference of the AuiNotebook to the AuiTabArt. This is
somehow cumbersome and not consistent with what AuiDockArt (the
rendering engine for AuiManager) does. AuiDockArt knows only about the
"style". So, I believe I am going to split window styles and AUI
styles in 2 keywords, so that the __init__ method of AuiNotebook can
be written like this:

def __init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition,
size=wx.DefaultSize,
                 aui_style=AUI_NB_DEFAULT_STYLE, win_style=0)

I know it might break someone else's code (although the only person I
know that is using (?) AUI is Werner)

Using it is a bit strong :slight_smile: at the moment. Currently still doing more testing/trial stuff, but have a definite plan to use it in my shareware.

and I also know it will not be
interchangeable with wx.aui.AuiNotebook. Unless someone can come up
with a better solution...
  

Pity that it is not interchangeable, but there are anyhow already a few things were it moves away (i.e. is better) from wx.aui (perspective saving). If ever wx.aui catches up and is faster/better then wx.agw.aui then one might have to deal with this and recode some stuff - no big deal in my case.

Anyhow, thanks again for this very nice widget.

Werner

Andrea Gavana wrote:

Hi All,

It's a bit OT, but it looks like we are going to have some nice
enhancements of wx.aui in wxWidgets:

http://lists.wxwidgets.org/pipermail/wx-dev/2009-April/113902.html

I hope I am not going to abandon PyAUI for the second time... :smiley:
  

Would be a pity for all the time/work you put into it.

On the other hand it could be used as valuable input to the wxWidgets work to be done, i.e. make Malcolm MacLeod and Bryan Petty aware of the work you have done and work with them to get things like perspective saving for notebooks included in this new version.

Werner

Andrea,

<snip>

I know it might break someone else's code (although the only person I
know that is using (?) AUI is Werner) and I also know it will not be
interchangeable with wx.aui.AuiNotebook. Unless someone can come up
with a better solution...

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
______________________________________

Hey! I'm messing with your AUI too...just not as extensively as Werner. Unfortunately, I'm finishing a class and working on a book review for my blog, so my uptake on it is going pretty slow. Hopefully I can start really using it in the next week or two.

Besides, it takes forever for these Google Code contributions to make it into the official releases. But yes, some of the proposals do look interesting, although you've already done some of this stuff and if you wanted to, you could make a really cool ribbon bar. Admittedly, I haven't decided if I like the ribbon bar yet. Some of its features are nice, but it's also confusing if you've used the old style for over a decade.

···

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org

Hi Mike,

Andrea,

<snip>

I know it might break someone else's code (although the only person I
know that is using (?) AUI is Werner) and I also know it will not be
interchangeable with wx.aui.AuiNotebook. Unless someone can come up
with a better solution...

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
______________________________________

Hey! I'm messing with your AUI too...just not as extensively as Werner.
Unfortunately, I'm finishing a class and working on a book review for my
blog, so my uptake on it is going pretty slow. Hopefully I can start really
using it in the next week or two.

Sorry, I didn't mean to offend anyone :smiley: ... I know that Cody has
extensively tested my version of AUI, I only (erroneously) thought
that Werner was implementing his shareware app using AUI.

Besides, it takes forever for these Google Code contributions to make it
into the official releases. But yes, some of the proposals do look
interesting, although you've already done some of this stuff and if you
wanted to, you could make a really cool ribbon bar. Admittedly, I haven't
decided if I like the ribbon bar yet. Some of its features are nice, but
it's also confusing if you've used the old style for over a decade.

Well, one of the other wxWidgets GSOC proposals which has been
accepted is the implementation of the RibbonBar in wxWidgets, so we
may have a ribbon in wxPython too when it's ready. In any case, I too
haven't decided if I like the RibbonBar, and the very presence of the
RibbonBar in the Office applications is what made my wife force me to
scrap Vista and downgrade to XP. Not that I am complaining...

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

···

On Wed, Apr 22, 2009 at 3:04 PM, Mike Driscoll wrote:

Andrea Gavana wrote:

Hi Mike,

Andrea,
    

<snip>

I know it might break someone else's code (although the only person I
know that is using (?) AUI is Werner) and I also know it will not be
interchangeable with wx.aui.AuiNotebook. Unless someone can come up
with a better solution...

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
______________________________________
      

Hey! I'm messing with your AUI too...just not as extensively as Werner.
Unfortunately, I'm finishing a class and working on a book review for my
blog, so my uptake on it is going pretty slow. Hopefully I can start really
using it in the next week or two.
    
Sorry, I didn't mean to offend anyone :smiley: ... I know that Cody has
extensively tested my version of AUI, I only (erroneously) thought
that Werner was implementing his shareware app using AUI.

No worries. I hope to be able to create something cool with AUI that I can share with the community. Besides, this gives me an excuse to learn it so I can help the other newbs on the list. :slight_smile:

Besides, it takes forever for these Google Code contributions to make it
into the official releases. But yes, some of the proposals do look
interesting, although you've already done some of this stuff and if you
wanted to, you could make a really cool ribbon bar. Admittedly, I haven't
decided if I like the ribbon bar yet. Some of its features are nice, but
it's also confusing if you've used the old style for over a decade.
    
Well, one of the other wxWidgets GSOC proposals which has been
accepted is the implementation of the RibbonBar in wxWidgets, so we
may have a ribbon in wxPython too when it's ready. In any case, I too
haven't decided if I like the RibbonBar, and the very presence of the
RibbonBar in the Office applications is what made my wife force me to
scrap Vista and downgrade to XP. Not that I am complaining...

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

Vista SP1 isn't really all that bad. I do dislike the hard drive thrashing and it is definitely slower at booting and coming out of standby than XP, but it's quite stable and pretty quick once it's up. Windows 7 sounds like it will be better though.

- Mike

···

On Wed, Apr 22, 2009 at 3:04 PM, Mike Driscoll wrote:

Andrea Gavana wrote:

Well, one of the other wxWidgets GSOC proposals which has been
accepted is the implementation of the RibbonBar in wxWidgets, so we
may have a ribbon in wxPython too when it's ready. In any case, I too
haven't decided if I like the RibbonBar, and the very presence of the
RibbonBar in the Office applications is what made my wife force me to
scrap Vista and downgrade to XP. Not that I am complaining...
  
The ribbon has absolutely nothing to do with Vista. That is strictly a
feature of Office 2007. You can run Office 2003 on Vista if you hate
the ribbon.

The ribbon is somewhat controversial. Microsoft rarely makes huge UI
changes without doing real user interface research, but almost everyone
I know hates it.

···

--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

Sorry, let me rephrase it: "... and the very presence of the
RibbonBar in the Office applications
WhichCamePreInstalledAndIDontHaveOffice2003ForHerToInstall(), together
with UAC, disk operations running endlessy, Windows updates which
killed the right-click context menu, DRM, and many others is what made
my wife force me to scrap Vista and downgrade to XP. "

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

···

On Wed, Apr 22, 2009 at 7:49 PM, Tim Roberts wrote:

Andrea Gavana wrote:

Well, one of the other wxWidgets GSOC proposals which has been
accepted is the implementation of the RibbonBar in wxWidgets, so we
may have a ribbon in wxPython too when it's ready. In any case, I too
haven't decided if I like the RibbonBar, and the very presence of the
RibbonBar in the Office applications is what made my wife force me to
scrap Vista and downgrade to XP. Not that I am complaining...

The ribbon has absolutely nothing to do with Vista. That is strictly a
feature of Office 2007. You can run Office 2003 on Vista if you hate
the ribbon.

The ribbon is somewhat controversial. Microsoft rarely makes huge UI
changes without doing real user interface research, but almost everyone
I know hates it.

Tim Roberts wrote:

The ribbon is somewhat controversial. Microsoft rarely makes huge UI
changes without doing real user interface research, but almost everyone
I know hates it.

I don't like it much either, and yet it is a very common request received by the wxWidgets team.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!