[futurebasic] Re : [FB] Crashing Popups Revisited

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : January 1999 : Group Archive : Group : All Groups

From: "jonathan" <jonathan@...>
Date: Tue, 26 Jan 1999 16:03:05 +0100
>Over the past several months there has been many threads about how to
>build popups on the fly.  
>
>One thing that I have noticed that seems to have gone unsolved is that it
>seems that everyone has been having problems with random crashes when
>using these popups after the program has been running for a while. 
>Everything seems to work fine at first, but after some time has passed my program
>seems to hang on the routine that builds and displays the popup.
>
>Has anyone figured out what may be causing this???

yep

programming pop-ups to crash is easy! just put em in and let'em rip!

In order to stop em crashing, (just after, they never crash when
you want, always after, leaving you to suspect miles of innocent
code first) always:

install - use - kill.

In practice this is:
* have a stub menu (eg 4000) in your resources
  If you already know what you want in, fine, put it
  in, if not, you're gonna have to add the stuff on the fly,
  just the same as for a normal menu.
* detect a mouseclick on the spot where the pop-up is.
* now, build the handle
* show it
* when the user leaves - kill the handle
* then treat the menu result.

never leave a pop up menu handle dangling around, it's just
waiting to make mischief.

HTH
jonathan