|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Wed Apr 22, 2020 2:58 am Post subject: Running an initiialization process on the opening window |
|
|
I'm looking for anyone who has done this kind of thing before.
I want to create an opening window with c %cw imbedded as a child. As the program initializes, the %cw will show any configuration errors. I also use this for debugging.
I used %sc to have the program init code run when the window was being created. However, the %cw wasn't "active", so didn't accept the data being written to it.
I have though of two possibilities; perhaps there are more.
One would be to set a timer to expire and that expiration would initiate the initialization. I then set the timer delay to a long time in the future so it doesn't expire again. In this way (I think), the main window is fully created and can accept data written into the %cw.
The other would be to use %lw to have the window created, then run the init code. At the end, it just sits in a loop, sleeping and yielding program control.
For me, either way is acceptable, but perhaps there is a different way.
Thoughts? |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7924 Location: Salford, UK
|
Posted: Wed Apr 22, 2020 8:21 am Post subject: |
|
|
As you probably know, for a Windows executable, simple Fortran print statements like PRINT*, "Hello" will automatically generate a separate %cw window.
Maybe the simplest way forward is for you to post a simple demo of your trial approach that failed. |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Wed Apr 22, 2020 9:44 am Post subject: |
|
|
Hi Bill,
If you want this window to be a child as in one of the child windows in an MDI frame, then obviously the parent has to be fully formed first.*
What stops you using a simple dialog box? I usually have a startup window with a logo, version number, credits and acknowledgements etc, and that shows before the main window - although why bother with the speed at which my apps open in comparison to (say) MS Office?
I notice that some programs like my CorelDRAW use such a startup window to also let the user make a selection between opening an existing file or creating a new one, and perhaps you could use that mechanism to report config errors.
Eddie
*Incidentally, I was tempted to use the chicken-egg meme, but the answer to a geologist is clear - the egg, as there were eggs before there were chickens! |
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Wed Apr 22, 2020 2:47 pm Post subject: |
|
|
Paul, what I am trying to avoid during the initialization (read of a configuration file and output of errors or values detected during that read) is the creation of that first %cw window. Unfortunately, without a great deal of effort, I cannot come up with a simple example. I tried using %dl, but I also use a %dl in creating the splash screen at the start (nod to Eddie). You can't do that.
Eddie, the simple dialog box is the splash screen. That displays for a short period of time. The main window is active at that time, but when the main window becomes active, the configuration file has to have been read in and processed. If there is a problem in the configuration, the user is notified of that in the %cw child window of my main window. The user can then select a different configuration (or edit) and reload. Again, the %cw shows success or failure.
N.B.: Apparently, when the documentation says "A given window cannot have more than one timer.", it also means that a timer cannot be attached to a window being created while another timer. is running in the parent of that window. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7924 Location: Salford, UK
|
Posted: Wed Apr 22, 2020 4:32 pm Post subject: |
|
|
At the moment %dl provides only one timer for a given main window (i.e the root parent window). Once started, the timer interval can be changed but the only way to stop the timer is to close the window.
This functionality could be extended and made more flexible. For example, more than one timer could be permitted whilst timers could be made to start or stop on the fly, that is, start at some point after the window has been created or stopped without closing the window. |
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Thu Apr 23, 2020 6:31 am Post subject: |
|
|
Paul, actually, the ability to cancel a timer might be a very good thing to do. Also, what you have suggested for an increase in functionality (multiple timers); I can see how one might be able to use this concept for a simulation, with multiple timers, one could have some interesting simulations. I remember GPSS on the IBM 7040 and simulating systems......... |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7924 Location: Salford, UK
|
Posted: Fri Apr 24, 2020 8:21 am Post subject: |
|
|
The next release of ClearWin+ will allow more than one %dl per window and will provide new functions SET_TIMER@(hWnd, delay, callback) and KILL_TIMER@(hWnd, callback) where hWnd is obtained from %hw. |
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Fri Apr 24, 2020 2:00 pm Post subject: |
|
|
Awesome! This will be of great help to me. Thanks for doing this!
Bill |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|