Re: Responsive Splash Screen while creating GUI objects
Zig Zag <[email protected]>
| Newsgroups | gmane.comp.python.wxpython |
|---|---|
| Message-ID | <CAKTuhnfN0g8cq_v9PFs=dxHms83bZJbZFXyz2RV8BxjcEFOgrA@mail.gmail.com> |
Hello Jasper, maybe this, try these links: https://wiki.wxpython.org/Customized%20splash%20screen%20%28Phoenix%29 https://wiki.wxpython.org/Splash%20screen%20while%20loading%20%28Phoenix%29 Cordially <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> Garanti sans virus. www.avast.com <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> Le mer. 13 mai 2020 à 16:42, Jasper Alexion <[email protected]> a écrit : > Thank you for your advice. It is much appreciated. > > > > A couple of points: > > 1. Our application contains thousands of GUI objects, which is significantly > slower than the 900 you tested with. We use roughly 3000 GDI objects > and 5000 USER objects in Windows 10. We know this is far from optimal, > and we are working towards lowering this in the future. > 2. In my question I stated that the work to be done as purely building > GUI. This is an oversimplification. We do have database queries and > internal business logic that also takes time. However, by using a profiler > we have determined that the creation of the GUI by far the most time > consuming > > > > In short: We are sure it’s the GUI that’s taking the majority of the time > > > > On Tuesday, May 12, 2020 at 10:10:44 PM UTC+2, johnf wrote: >> >> I created a reasonably large app and was concerned about how long the app >> was taking to load. So, as an experiment I create a frame with approx. 900 >> objects on a scroll panel. It loaded in just a couple seconds - some times >> less on a windows 10 box. It made me realize that it was not the wxPython >> GUI objects that was taking the time but my database connections. I wonder >> if you are having the same issue as I did? >> >> Python 3.6, wxPython 4.0.7, windows 10. >> >> Johnf >> >> On 5/12/20 7:03 AM, Jasper Alexion wrote: >> >> Hello, >> >> >> We are currently in the process of creating a splash screen for our >> application and we are encountering a problem that causes the GUI to become >> unresponsive. >> >> >> Our application has a very large GUI containing thousands of fields and >> labels. Creating this GUI takes around 10 seconds. In the long term we >> are working towards redesigning our application more towards MVC, but as of >> now it is impossible to dynamically create the GUI when needed. >> >> >> >> Goal: >> >> 1. We want a responsive splash screen while our application is >> starting. >> 2. Responsive means: draggable window, moving wx.Gauge, etc.. >> >> >> 1. >> 1. >> >> >> >> Problem: >> >> 1. We can only create GUI objects from the GUI-thread that runs the >> mainloop >> 2. When the mainloop is busy creating GUI objects, the WHOLE >> application (at least the GUI part) freezes. >> >> >> 1. >> 1. >> >> >> >> Notes >> >> 1. We could use wx.Yield() to let the splash screen update itself. >> However, this would result in a splash screen that sporadically >> updates at random moments instead of being responsive at all times with >> a nice smooth flowing wx.Gauge >> 2. We are using threads (wx.Timer,wx.PostEvent,wx.CallAfter) to keep >> (parts of the) splash screen responsive, this works well during >> normal operation. However, as soon as the mainloop is too busy to >> handle wx events the whole GUI freezes. >> >> >> 1. >> 1. >> >> How could we achieve this? >> >> >> >> We are using Python 3.8.2 and the following libraries: >> >> numpy==1.18.4 >> Pillow==7.1.2 >> Pypubsub==4.0.3 >> six==1.14.0 >> wxPython==4.1.0 >> >> >> >> Thanks in advance, >> >> Jasper >> -- >> You received this message because you are subscribed to the Google Groups >> "wxPython-users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/wxpython-users/bf3743b8-79d1-463d-8b78-d447e206377a%40googlegroups.com >> <https://groups.google.com/d/msgid/wxpython-users/bf3743b8-79d1-463d-8b78-d447e206377a%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> >> >> -- > You received this message because you are subscribed to the Google Groups > "wxPython-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/wxpython-users/f40b8cd9-84d5-4d52-af02-dfd135fc8c0d%40googlegroups.com > <https://groups.google.com/d/msgid/wxpython-users/f40b8cd9-84d5-4d52-af02-dfd135fc8c0d%40googlegroups.com?utm_medium=email&utm_source=footer> > . > <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> Garanti sans virus. www.avast.com <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> -- You received this message because you are subscribed to the Google Groups "wxPython-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/CAKTuhnfN0g8cq_v9PFs%3DdxHms83bZJbZFXyz2RV8BxjcEFOgrA%40mail.gmail.com.