Fwd: Re: Help: Does anyone use legacy message box behavior?

Richard Gaskin ambassador at fourthworld.com
Tue Feb 7 11:04:32 EST 2017


I sent this a while ago, and oddly enough another message I'd sent lae 
came in but this one did not.

After thinking about this some more, I wonder:  are you sure the LC IDE 
doesn't rely on this?

My Message Box replacement sets the revMessageBox redirect to empty when 
it closes, and after doing so the LC IDE Message Box resumes normal 
behavior.

I don't mind modifying mine if needed, but since an empty revMessageBox 
redirect allows the LC IDE to resume use of its own Message Box, and 
since the LC IDE's Message Box stack is still named "Message Box", it 
would seem the engine behavior you describe is still in use.

Please let me know if I misunderstand.  But FWIW one nice thing about 
that behavior is that it keeps things simple, allowing a useful default 
in the IDE even if the revMessageBoxRedirect is set to not restored to a 
valid field reference.

Is it necessary to remove the old behavior?

- rg


-------- Forwarded Message --------
Subject: Re: Help: Does anyone use legacy message box behavior?
Date: Tue, 7 Feb 2017 07:37:30 -0800
From: Richard Gaskin <ambassador at fourthworld.com>
To: use-livecode at lists.runrev.com

Monte Goulding wrote:

> I’m in the midst of making the message box redirect work in all
> engines (https://github.com/livecode/livecode/pull/5156
> <https://github.com/livecode/livecode/pull/5156>) and it would seem
> that there’s a legacy message box behavior that could be removed from
> the engine. It’s not used by the IDE. The behavior is if no message
> box redirect is set then it looks for a stack named “Message Box”,
> sets the text of the first field then raises the stack. As this is
> only an IDE thing I strongly suspect we are ok to remove the code
> but while I’m waiting for the team to wake up in Scotland I thought
> I’d check here!
>
> It would be easy to work around even if you have been depending on it
> because it’s just setting the property and then handling msgChanged
> to put msg where ever you want.

IIRC what you describe is the original engine behavior which drove the 
MC IDE.  I believe that was also used by early versions of the LC IDE.

The revMessageBoxRedirect global property was a solution added to 
satisfy a request I had for being able to use the MC IDE as a plugin 
within LC.  If the LC IDE now also uses that property itself that would 
seem a cleaner implementation.

Removing the engine behavior you describe will break the MC IDE, but 
given how few people use it these days I don't think that should be a 
reason to clutter the code base.  Those interested could easily add the 
one line of code needed to use revMessageBoxRedirect instead.

Personally, I don't use anything dependent on the older behavior, but I 
do use revMessageBoxRedirect very extensively; among other things I've 
been using a custom Terminal-like Message Box replacement for years.

Being able to use my custom Message Box in a standalone would be a 
godsend.  If removing the old behavior makes a cleaner way to do that I 
say go for it.

-- 
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  Ambassador at FourthWorld.com                http://www.FourthWorld.com




More information about the use-livecode mailing list