Ghost of field 3

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9567
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Ghost of field 3

Post by dunbarx » Tue Mar 21, 2023 1:57 pm

I thought this warranted a new thread.

In a new session I make a new stack and pull a field from the tools palette. I make sure the field does not have focus, though it hardly matters. From msg:

Code: Select all

answer the selectedField
I get "Field 3" I can do this all day.

Craig

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9250
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Ghost of field 3

Post by richmond62 » Tue Mar 21, 2023 2:04 pm

That is fun.

I just did that at work (or, probably more accurately, "work") in LiveCode 8.1.10.

What is even more fun is one can do that with NO field at all:
-
Screen Shot 2023-03-21 at 3.01.59 pm.png
-
and my second picture may asnwer the question:
-
Screen Shot 2023-03-21 at 3.03.26 pm.png
-
It might be vaguely instructive to know where fields 1 and 2 are. 8)

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9250
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Ghost of field 3

Post by richmond62 » Tue Mar 21, 2023 2:11 pm

IFF that constitutes a bug . . .

{Personally I would not fuss about it, except if one is worried about whether an end-user has got their insertion
point where you do or don't want it to be.]

. . . then someone 'top-dead-centre' might have to spend a short period in the naughty corner
as it has, obviously, been there a while.

Just for added entertainment value RevMedia 4 returns field 2. :D
-
Screen Shot 2023-03-21 at 3.09.22 pm.png

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9567
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Ghost of field 3

Post by dunbarx » Tue Mar 21, 2023 2:16 pm

Richmond.

It may seem like fun, but it could easily cause havoc, in the sense that Marc Antony meant, in ones handler.

Craig

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9250
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Ghost of field 3

Post by richmond62 » Tue Mar 21, 2023 2:40 pm

I really meant 'fun' to be read in an ironic sense, as, of course, that could throw things right out of whack.

Certainly the messageBox should not be showing up on the radar.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9250
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Ghost of field 3

Post by richmond62 » Tue Mar 21, 2023 2:47 pm

Because I have another 15 minutes free, I made a stack with this script in a button:

Code: Select all

on mouseUp
   answer the selectedField
end mouseUp
Now, what is interesting is what happens then:
-
Screen Shot 2023-03-21 at 3.47.13 pm.png
-
If one builds a standalone of that stack, one gets the same result.

So, I, for one, would NOT get 'all hot and sweaty' about it.
Attachments
Cheese Crackers.livecode.zip
Stack.
(1.47 KiB) Downloaded 51 times

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9567
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Ghost of field 3

Post by dunbarx » Tue Mar 21, 2023 5:24 pm

Now we are getting nowhere.

So that line of code "works" from a button script, but returns "Field 3" from the message box.

Well, the message box was always a bit suspect.

Craig

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7210
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Ghost of field 3

Post by jacque » Tue Mar 21, 2023 5:30 pm

Once you have typed into the message box, it becomes focused. Field 3 is the field in the message box where you enter commands.

The best way test this is to put the command into the field or card with a trigger of some kind, like putting the selected field in a keyDown handler, or into any handler that is called when the field is active. It should also work from a button provided the button's traversalOn is false.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9567
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Ghost of field 3

Post by dunbarx » Tue Mar 21, 2023 6:00 pm

Jacque.

OOOH. All is now solved.

I keep forgetting that the message box is "just a stack", my favorite annoying comment.

But I believe the message box ought to 100% recuse itself from the other objects in play. I know this is the reason that, since it does not (cannot?), it has gotten a bad rap over the years with other odd activities.

Craig

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9250
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Ghost of field 3

Post by richmond62 » Tue Mar 21, 2023 8:09 pm

Well, as the messageBox IS part of the programming interface, and should not be present in a standalone.

Wait a big, CHEESY moment . . .
-
SShot 2023-03-21 at 21.07.04.png
-
LC 9.6.3 'Community', MacOS 13.3 Beta 4
-
SShot 2023-03-21 at 21.11.04.png
-
SShot 2023-03-21 at 21.11.34.png
-
Everything behaves as . . . 8)

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9567
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Ghost of field 3

Post by dunbarx » Tue Mar 21, 2023 9:23 pm

Richmond.

I guess that since this:

Code: Select all

answer the selectedField
returns empty, then this:

Code: Select all

answer the name of the selectedField
has nowhere to look, nowhere to go, and complains.

Craig

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9250
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Ghost of field 3

Post by richmond62 » Wed Mar 22, 2023 5:58 am

But, it does not default to the messageBox field.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9250
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Ghost of field 3

Post by richmond62 » Wed Mar 22, 2023 9:28 am

Just for tidiness's sake I have recreated last night's exercise here at work in LC 8.1.10 (Mac OS 10.7.5),
and what is OBVIOUS to me is that 'ghost' only appears when you put the code into the messageBox:
-
c1.jpg
-
c2.jpg
-
Screen Shot 2023-03-22 at 10.26.21 am.png
-
AND as you ar NEVER likely to us the messageBox in a standalone, the whole thing is a ghost
and a storm in a teacup.

Post Reply

Return to “Talking LiveCode”