08-08-2024 12:59 PM - edited 08-08-2024 01:33 PM
We pop up a splash screen panel on startup:
if ((g_PanelSplashScreen = LoadPanel (0, "PanelSS.uir", PANEL_SS)) < ZERO) return NEG_ONE;
SetCtrlVal (g_PanelSplashScreen, PANEL_SS_VERSION, _TARGET_PRODUCT_VERSION_);
SetCtrlVal (g_PanelSplashScreen, PANEL_SS_STATUS, "Loading user interface...");
DisplayPanel (g_PanelSplashScreen);
...and then at the end of the routine we hide it:
// Hide splash screen panel.
HidePanel (g_PanelSplashScreen);
But it often sticks on the screen and does not hide. Clicking on it makes it disappear.
If I run it in the Debugger (either Release or Debug build) it seems to work. But then if I run the .exe that was produced for the debug session, the panel does not go away. Weird.
Any thoughts on what could cause this?
08-11-2024 12:43 AM
Try to use SetPanelAttribute(panel,ATTR_VISIBLE,0) ;
08-12-2024 09:07 AM
@GabelDaniel wrote:
Try to use SetPanelAttribute(panel,ATTR_VISIBLE,0) ;
Ah, I had not thought of that.
I gave that a try this morning, and no change. BUT, it did lead me to what may be a solution.
We display the pop up, then eventually call a function that does startup things, and I SetCtrlVal() to a text field on the screen, giving status of what is going on. At the end of that last function, I would HidePanel(). Then, it goes back to main and displays something like "Starting user interface..." right before RunUserInterface(). I thought maybe modifying that panel was making it display. I commented that out, and still no change.
But, moving the HidePanel() there "seems" to work -- at least, I have tested it a few times this morning with no stuck splash screen. I am not sure why a HidePanel() only works "sometimes" in the function, but I'm going to test this more and see if this finally makes this panel hide properly.
08-16-2024 03:40 AM - edited 08-16-2024 03:40 AM
Have you ever tried trapping the return code from HidePanel ()? It could return a meaningful value that sheds some light on what's going on.
Just my 2c
08-16-2024 08:57 AM
@RobertoBozzolo wrote:
Have you ever tried trapping the return code from HidePanel ()? It could return a meaningful value that sheds some light on what's going on.
Just my 2c
Yes, early on, when this first started happening, I added error checking to that call, but it just blows on by.
Also, don't non success errors trigger a breakpoint, by default, when running in the debugger? I know SetCtrlValue/Attribute will break if the panel handle is wrong and the control ID is if the wrong data type.
08-26-2024 04:00 PM
Roberto, you beat me to this idea. I was thinking the same thing. And this is generally a great, easy troubleshooting thing to do with all library functions! Has rescued me more times than I can count.
08-29-2024 02:57 AM
@AllenInIowa ha scritto:Also, don't non success errors trigger a breakpoint, by default, when running in the debugger? I know SetCtrlValue/Attribute will break if the panel handle is wrong and the control ID is if the wrong data type.
Check Run >> Break on >> Library Errors menu item: it is a bit obscure to me when the IDE breaks if this item is not checked.