I want a function to create and then close an xmessage dialog box… but so far, I can get the message to open but not close.
I have a simple bit of code:
AddToFunc OpenAndCloseXmessage
+ I Exec exec xmessage "here is my xmessage"
+ I Schedule 100 CloseXmessage
AddToFunc CloseXmessage
+ I All (xmessage) Close
can anyone see anything wrong with this? I sure can’t…
I wasn’t giving xmessage enough time to finish instantiating. changing the scheduling delay to 500 from 100, when calling CloseXmessage, works just fine.
AddToFunc OpenAndCloseXmessage
+ I Exec exec xmessage "here is my xmessage"
+ I Schedule 500 CloseXmessage
AddToFunc CloseXmessage
+ I All (xmessage) Close
No, no, no! “All” does just what you think it does – it matches every instance. Use “Next” where you want the specific (and likely) window to be closed.
Note also (more importantly) that xmessage has a -timeout flag to it to make itself close after a known interval. Far too many people seem to think that the WM is there to circumvent an application’s shortcoming. It’s not!