Phoenix icon indicating copy to clipboard operation
Phoenix copied to clipboard

lib.agw.aui random crashes and other things

Open kdschlosser opened this issue 2 months ago • 1 comments

Operating system: Windows 11 wxPython version & source: pypi Python version & source: CPython 3.11

Description of the problem: Random crashes. Try using the demo and turn some of the different settings on and off and it will eventually crash.

also a toolbar is not a menu and it shouldn't have event that are menu events. There should be proper events for when a tool is toggled or when a cool is clicked or when a radio is changed for a series of tools.

Using a tool separator to define a radio group is not really ideal. There should be a way to add/remove tools from a radio group and that group should not need to be dictated by adding a separator to the toolbar.

naming of things is inconsistent. In one area a toggle tool is called a toggle tool but in another it's a check tool. It's confusing to see a method for AddCheckTool and then another method named AddToggleTool what is the actual difference if there is any?

what is a "Normal" tool? is it a button? or is it simply some text and a bitmap that doesn't do anything?

None of the methods for the toolbar have any return values set so nothing appears in the documentation and the type checking in an IDE ends up not working....

"FindTool" methods should be renamed to GetTool because that is actually what the person is wanting to do.

There is no method in the manager to set the toggle/check state of a tool but there is one to get the toggle/check state.

these agwstyles are a bit strange... AUI_TB_VERTICAL AUI_TB_HORZ_LAYOUT AUI_TB_HORZ_TEXT

AUI_TB_VERTICAL shouldn't even exist. There is no AUI_TB_HORIZONTAL style and the style should be dictated by height > width. if the toolbar has a greater height than it does width than the toolbar should have the tools in a vertical orientation and if width >= height then the tools should be horizontal.

the naming of the AUI_TB_HORZ_LAYOUT and AUI_TB_HORZ_TEXT styles doesn't make sense. Horizontal text is what you are reading now. and vertical is seen below

V e r t i c a l

AUI_TB_TEXT should be renamed to AUI_TB_LABELS_BOTTOM and the AUI_TB_HORZ_LAYOUT should be renamed to AUI_TB_LABELS_RIGHT. These styles should turn on the labels so AUI_TB_HORZ_TEXT doesn't need to exist. Personally don't see a use case where positioning the label to the right of the icon would serve any purpose. if the toolbar is vertical it it going to make the toolbar really wide and when horizontal it will make it really long. IMHO it add complexity that doesn't need to be there.

the entire agw.aui module needs to be gone over to improve performance. If a complex UI is being made is when you really notice as the performance degrades exponentially with more controls that get added. Memory in most PC's these days is in abundance so if more memory needs to be used to cache things instead of having to draw them over again that should be something that gets done.

kdschlosser avatar Oct 13 '25 06:10 kdschlosser

The pure-Python version of AUI that lives in agw.aui was created about 20 years ago, with the purpose of being an alternative to the wxWidgets C++ version - which went unmaintained for a very long time.

The reason why things are as they are is that we have tried to maintain as much compatibility as possible with the C++ version, while giving many more features to the user.

I’m pretty sure that the two implementations have now diverged quite substantially as the wxWidgets version is now maintained and improved.

That said, I’m unclear what you expect the lone wxPython maintainer and the occasional contributors to do.

  • If the demo crashes, provide a traceback and a list of actions that lead to it
  • If you think some of the features or implementations are misleading, pointless or suboptimal, I’m sure @swt2c will gladly review PRs that make agw.aui better.

In the end, he will have to decide whether it’s worth breaking compatibility even more between the C++ version and this improved version of agw.aui. I couldn’t care less about compatibility but I’m not the maintainer.

infinity77 avatar Oct 13 '25 14:10 infinity77