Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Form won't stay open
Message
 
 
À
17/05/2009 18:48:34
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01400297
Message ID:
01400330
Vues:
65
>>>>I just figured what the problem is. I need to have READ EVENTS somewhere right after this form. But then I will need to have another READ EVENTS after the second form. A little confusing to have 2 READ EVENTS. Unless I am missing something else.
>>>
>>>I think, you need only one READ EVENTS in your code.
>>
>>I agree. I just can't seem to figure where to stick it. I think I need to get away from this problem; rest and maybe the solution will come to me later.
>
>Read Events happens when your startup code has set everything up and you're starting the event loop, i.e. waiting for the user to do something. Clear events happens when user exits, and then your cleanup code runs. Everything in between is an idle loop, when your app either responds to user actions, or external events (messages from OS - machine shutdown, perhaps, tracking OS events like directory content change), or runs on timers.
>
>Now you only need to figure out how to split your code into these three: startup, events, cleanup. You may choose to have several event loops - when user exits one, given some condition you may decide to restart the same loop (say - logout, or timeout and you require a fresh login), or user decides to run a different branch of the app so you start a different loop (for which you need a different startup code and the Read Events is in a different location in your code).
>
>If you want to run a single form with an implied event loop (without Read Events), it needs to be a modal form.

I probably do not understand something but your last line does not seem to work for me.

I have the following pseudo code in my main.prg:

1. Instantiate a modal form form. Wait for user to make a selection, then release this form.

2. Instantiate a modeless form that has ShowWindow property set to 2 - As top level form.

3. Read Events.

What happens is my code goes right by the step 1 (even though the form is modal) and stops on step 2. This part I can't understand. The form is modal; it should stop but it does not.

So I will probably need to incorporate the step 1 into INIT method of form in step 2.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform