Author Topic: Black background windows when running  (Read 6636 times)

0 Members and 1 Guest are viewing this topic.

Offline IronMan

  • Newbie
  • Posts: 38
    • View Profile
Black background windows when running
« on: March 26, 2020, 02:41:45 pm »
I have used InForm for one of my applications and it works very well with the exception for when starting, the program has a FAST black windows popup then disappear before loading the main Form and starting. It's like a fast Command Windows that blinks each time the application  starts. Not causing a problem in the way the applications runs, just a little unexpected when starting the app.

Is this something that is wrong inside my applications, or just a feature of using InForm?

Thanks.
- Kent

FellippeHeitor

  • Guest
Re: Black background windows when running
« Reply #1 on: March 26, 2020, 03:49:15 pm »
Aren't you using SHELL at all?

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Black background windows when running
« Reply #2 on: March 26, 2020, 04:25:23 pm »
This is actually just standard QB64 behavior.

When QB64 first starts, it starts up in an emulated SCREEN 0 text screen.  This is that black screen that you're seeing initially, before it swaps over to whatever SCREEN_NEWIMAGE you specify.

You might try $SCREEN HIDE at start up, and the switch to_SCREENSHOW after the new image call, but I personally haven't had much luck making it work as expected for me -- but I've never really did much more than play around with those commands...  They might've been updated/fixed and work perfectly fine now; I dunno.  One thing's for certain: it doesn't hurt to experiment and give it a shot.  ;)
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline TerryRitchie

  • Seasoned Forum Regular
  • Posts: 495
  • Semper Fidelis
    • View Profile
Re: Black background windows when running
« Reply #3 on: March 26, 2020, 05:32:01 pm »
What Steve said. On slower computers the initial screen 0 will be more noticeable. While testing out my latest game I ran it on hardware ranging from a single processor Pentium 1.4Ghz up to Quad core i7s. I distinctly remember noticing the black screen longer on the slower systems.
In order to understand recursion, one must first understand recursion.

Offline RhoSigma

  • QB64 Developer
  • Forum Resident
  • Posts: 565
    • View Profile
Re: Black background windows when running
« Reply #4 on: March 26, 2020, 05:41:57 pm »
This is actually just standard QB64 behavior.

When QB64 first starts, it starts up in an emulated SCREEN 0 text screen.  This is that black screen that you're seeing initially, before it swaps over to whatever SCREEN_NEWIMAGE you specify.

You might try $SCREEN HIDE at start up, and the switch to_SCREENSHOW after the new image call, but I personally haven't had much luck making it work as expected for me -- but I've never really did much more than play around with those commands...  They might've been updated/fixed and work perfectly fine now; I dunno.  One thing's for certain: it doesn't hurt to experiment and give it a shot.  ;)

Yes, place $SCREENHIDE in the beginning of the program, but different from Steve's suggestion, the _SCREENSHOW must definitly come before the SCREEN statement, otherwise the QB64-GL versions tend to hang and can only be killed via TaskManager. Timing is everything here, I did many experiments in GuiTools, because I also was very irritated/annoyed by that window flashing, so here is what I basically do in GuiTools now:
Code: QB64: [Select]
  1. 'program init here
  2. appScreen& = _NEWIMAGE(wid%, hei%, mode%)
  3. SCREEN appScreen&
  4. _DELAY 0.025
  5. 'more code follows here
  6.  
My Projects:   https://qb64forum.alephc.xyz/index.php?topic=809
GuiTools - A graphic UI framework (can do multiple UI forms/windows in one program)
Libraries - ImageProcess, StringBuffers (virt. files), MD5/SHA2-Hash, LZW etc.
Bonus - Blankers, QB64/Notepad++ setup pack