How to hide the main window until my module is loaded

Operating system: Win 10
Slicer version: Slicer 5.0.3
Expected behavior: Directly show the GUI of my module when I open MyModule.exe.
Actual behavior: It will show the Slicer welcome page for a second first and then jump to my GUI.

I write a module with its own interface for my project referring to the QuickSegment Slicelet example. And I clone the .exe and .ini files as stated here so I can open my module by MyModule.exe. The problem is when I open it the original Slicer GUI will show first and then automatically switch to my GUI.

Is there a way to prevent the Slicer GUI from showing? Or can I hide the main window as default and then call mainWindow.show() in my module?

Thank you!

You could play with the --no-main-window launcher option and see if you can display it again when your module is initialized.

However, you may want to look into Slicer Custom Apps. All you need to do is generate your custom app skeleton with the cookie cutter, add your module and set it as home module. Then you’ll have more control about the application.

Thanks for your reply! The --no-main-window option doesn’t work because I cannot launch my module without the main window. I will try the Slicer Custom Apps.

Yes this is why I used the word “play” with the option. When your module is up and its setup is called, you could try changing some setting of the main window then showing it for a moment before you hide it again… But the custom app is the hack-free way.