Optwindow = "toolbar=no,location=no,status=yes,menubar=yes," + Nmewindow = "win" + Today.getMinutes() + Today.getSeconds() + Make the following changes to use it at your site.ġ) Put the HTML files in a directory which can be reached by the web server.Ģ) Put the FOCEXEC in a directory that is in the APP PATH.ģ) Change the word "tststuff" in the URL path in the RUNIT() function in WAITMENUPAGE.HTM to the directory where WAITMESSAGE.HTM is located.ĭ_apprndm.value=apprndm ĭ_ex.value =_ex.value The following is some code to create a wait message page with the technique I use. I think standard browser behavior stops animated GIFs when the browser window is told to go to antoher web page even if that web page (or report results) take some time to come back. The technique I use does not seem to work with animated GIFs. In short, I have not found a way to show animated GIFs on a wait page. I added the xml source of MyAppUI.February 20, 2008, 03:07 PM mgrackinThe topic of wait messages has been discussed before but I'm not sure if animated GIFs was addressed. Worker = Worker (self.PreparingMyApp) # Any other args, kwargs are passed to the run function Self.gif_loading = QMovie ('ui/loading.gif') Worker = Worker (self.StartMyAppReport) # Any other args, kwargs are passed to the run functionĭef StartPreparingMyApp(self): #<= This method doesn't work !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! (self.progress_fn)ĭef PreparingMyApp(self, progress_callback): Worker = Worker (self.StartMyApp) # Any other args, kwargs are passed to the run function "Press 'button 'Quit' to stop and turn off MyApp.") Self.EditTextFieldUi (self.label_HeaderMsg2, '#ff8a00', You can press the button 'Report' to see what MyApp has done.") Self.EditTextFieldUi (self.label_HeaderMsg1, '#ff8a00', Self.gif = QMovie ('ui/animated_gif_logo_UI_.gif') Self.button_Run.setStyleSheet ("background-color: #ffcc00 ") # = We need to block the Button Run and change its color Self.button_ (self.ButtonStartMyApp)ĭef StartMyAppReport(self, progress_callback):ĭef ButtonStartMyApp(self): #<= This method works perfectly by showing the loading gif. Self.button_ (self.ButtonStartMyAppReport) # = Associate methods to the buttons of the UI = Self.StartPreparingMyApp() #<= This method doesn't work!!!! Print("Multithreading with maximum %d threads" % ()) # = THis will handle the MULTITHREAD PART = (result) # Return the result of the processing ((exctype, value, traceback.format_exc ())) Result = self.fn (*self.args, **self.kwargs) # Retrieve args/kwargs here and fire processing using them Initialise the runner function with passed args, kwargs. # Store constructor arguments (re-used for processing) :param kwargs: Keywords to pass to the callback function :param args: Arguments to pass to the callback function Kwargs will be passed through to the runner. :param callback: The function callback to run on this worker thread. Inherits from QRunnable to handler worker thread setup, signals and wrap-up. `object` data returned from processing, anything `tuple` (exctype, value, traceback.format_exc() ) I don't understand because the "Run" button works perfectly by showing the gif and running the main code without freezing the UI whereas my "preparing" code is not showing the gif and freezing my UI until it finishes.ĭoes anyone understand the source of this issue? from PyQt5 import QtWidgets, uic, QtGuiĭefines the signals available from a running worker thread. So I thought by cloning the same logic, I could display another loading gif at the init of my UI but it didn't work. My script has a button to Run my main script "StartMyApp" and show an animated gif while MyApp is running without freezing my UI. Instead of showing the gif, the UI is blocked(froze) waiting for my preparing script to finish its job. When I execute my code, it shows immediately the UI, then it supposes to make some other preparing stuff and display a loading gif while these initialization tasks are running.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |