New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wx.aui.AuiNotebook.SetArtProvider(wx.aui.AuiDefaultTabArt()) Crash! #1061

Closed
yxdragon opened this Issue Oct 29, 2018 · 10 comments

Comments

Projects
None yet
4 participants
@yxdragon
Copy link

yxdragon commented Oct 29, 2018

wx.aui.AuiNotebook.SetArtProvider(wx.aui.AuiDefaultTabArt()) make crash.
I saw the demo, wx.lib.agw.aui works.
some question:
diffrence between wx._aui and wx.aui?
wx.lib.agw.aui is writon in pure python, wx.lib.agw.aui and wx.aui, which one should i choose?

@Metallicow

This comment has been minimized.

Copy link
Contributor

Metallicow commented Oct 29, 2018

wx.aui is an underlying wxWidgets lib. The person that originally wrote it kinda disappeared a while ago and there was outstanding bugs and features not implemented. Andrea eventually came along and ported the C++ code into python so its bugs could be fixed and improvements be made. The work Andrea did is the wx.lib.agw.aui and is pure python.

... So to answer your question, which is better... wx.lib.agw.aui is more bug free and polished. the wx.aui might run faster, but has outstanding bugs and missing features, so if you are not using just a simple notebook, most would say go with the python library version.

wxWidgets has AUI on its rewrite list, but it might be quite some time before that ever gets done and sees the light of day on the C++ side of things.

@yxdragon

This comment has been minimized.

Copy link

yxdragon commented Oct 29, 2018

then, wen i use wx.aui.AuiNotebook.SetArtProvider, and give a wx.aui.AuiDefaultTabArt(), it crash, and I print(notebook.GetArtProvider()), it is a wx._aui.AuiDefaultTabArt() object, is it a wx's bug? or I did not use it correctly?

@yxdragon

This comment has been minimized.

Copy link

yxdragon commented Oct 29, 2018

infact, i just want to draw a bitmap as the notebook's blank background, but I found the code i wrote doesnot work, I think the paint method is overritten by the art provider, How can I draw on the blank background?

@Metallicow

This comment has been minimized.

Copy link
Contributor

Metallicow commented Oct 29, 2018

I'm not exactly sure what you are wanting to texture... Could you provide a small sample app and/or a picture of what you want to do. I use wx.lib.agw.aui and the only things I alter in my custom version is notebook tab arts and manager art background from the default gradient.

This is a pic of what I can texture in my apps.
customauitexture

Also, have you looked at the official wx.lib.agw.aui demo?

@RobinD42

This comment has been minimized.

Copy link
Member

RobinD42 commented Oct 30, 2018

then, wen i use wx.aui.AuiNotebook.SetArtProvider, and give a wx.aui.AuiDefaultTabArt(), it crash, and I print(notebook.GetArtProvider()), it is a wx._aui.AuiDefaultTabArt() object, is it a wx's bug? or I did not use it correctly?

It's a bug. Ownership of the art object was not being transferred correctly from Python to C++, so it was being destroyed immediately after the SetArtProvider call since you were not saving a reference to it. Then when the notebook tried to use it then it crashed because it had a bad pointer.

I have a fix on the way.

@RobinD42

This comment has been minimized.

Copy link
Member

RobinD42 commented Oct 30, 2018

Fixed by #1065

@RobinD42 RobinD42 closed this Oct 30, 2018

@jensgoe

This comment has been minimized.

Copy link
Contributor

jensgoe commented Oct 30, 2018

wxWidgets has AUI on its rewrite list, but it might be quite some time before that ever gets done and sees the light of day on the C++ side of things.

Didn't know that. Where can i find this rewrite list?

@Metallicow

This comment has been minimized.

Copy link
Contributor

Metallicow commented Oct 30, 2018

@jensgoe It was an item on the bug/feature/todo trac at one point iirc. It's buried somewhere in there.
Edit: https://trac.wxwidgets.org/wiki/Roadmap
Looks like it keeps getting bumped up... a rewrite would be alot of work, so dont hold yer breath i'd say... maybe someday...

@yxdragon

This comment has been minimized.

Copy link

yxdragon commented Oct 30, 2018

I use wx.aui at first, but notebook setartprovider crashed, and wx4.03, the page cannot be closed! then I change wx.lib.agw.aui, but on mac, when open two pages, and drag one be left-right, then if we drag the right back to the left one, it crashed.

I just want to add a watermark to the blank notebook (when there is no page), at first I think I should override the tabartprovider's drawbackground, later, I find I should use dockargprovider. and now I add a watermark successfully!

another question, I want use a advencedsplash when open the software, my program need 3s to load, but the splash show in nocolor, untill my program be loaded, and enter mainloop, it looks right.

I 'd like the splash show first, and my program loaded in back. need I use a pubsub here?

my projects here: https://github.com/Image-Py/imagepy

@Metallicow

This comment has been minimized.

Copy link
Contributor

Metallicow commented Oct 31, 2018

@yxdragon I think the best thing to do for your help with splash and other stuff would be to ask on the wxPython mailing lists or make a help wanted issue on your project. Good to hear you got your texture issue figured out :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment