Answer function
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 9837
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Answer function
Curious. That's an engine thing I presume?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Answer function
could someone post an example of a modal stack leaking mouseDown messages? (just for my own curiosity, as when i test this i can't make it happen...)
Just for curiosity's sake...
Just for curiosity's sake...
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: Answer function
I've got a sample stack in the bug report linked to earlier.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
Re: Answer function
Yeh except that doesn't replicate the problem either.
I presume you're referring to this: https://quality.livecode.com/show_bug.cgi?id=22977
I downloaded the test stack. Using either "no substack" or "substack" and clicking on either the buttons in the modal does not trigger a breakpoint for me... ever.
Not sure what's different with my setup other than i've probably used this a lot less than most of you, haven't modified anything and am probably using many fewer plugins...
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: Answer function
Got it. There's now an updated test stack there that will avoid debugger issues and just place some text in the message box.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: Answer function
Richard- was that last question aimed at me? From the dictionary:
andThe modal command pauses the running handler until the
modal dialog box is dismissed (usually by clicking a button in the
modal dialog box).
While a modal dialog box is open, other windows cannot be edited or
brought to the front. Because of this, you should use modal dialog boxes
only when a stack must obtain feedback from the user before it can
continue.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
-
- VIP Livecode Opensource Backer
- Posts: 9837
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Answer function
Thanks, Mark. Both of those are good descriptions, but do not address what's being referred to as "message leaking" (what we usually call "normal message path").
The first snippet says the calling handler is blocked, which seems to be happening in this test case so that much is fine.
The second refers to the behavior of a fully modal window, but doesn't say all system messages are suspended.
What am I missing?
The first snippet says the calling handler is blocked, which seems to be happening in this test case so that much is fine.
The second refers to the behavior of a fully modal window, but doesn't say all system messages are suspended.
What am I missing?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: Answer function
Er...they're not "suspended", they're just contained within the modal dialog.
So you can press keys in an Ask dialog and they're handled, but pressing keys in any other stack or control has no effect.
Modal dialogs force the user to interact with them before they can do anything else. I even have a hard time envisioning a use case for user-generated modal dialogs that need to handle system messages outside the modal stack itself.
MouseMove messages are also leaked from Answer and Ask modal stacks but I think that's an even more obscure edge case.
So you can press keys in an Ask dialog and they're handled, but pressing keys in any other stack or control has no effect.
Modal dialogs force the user to interact with them before they can do anything else. I even have a hard time envisioning a use case for user-generated modal dialogs that need to handle system messages outside the modal stack itself.
MouseMove messages are also leaked from Answer and Ask modal stacks but I think that's an even more obscure edge case.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
-
- VIP Livecode Opensource Backer
- Posts: 9837
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Answer function
Yes, I'd expect key events to go to the topmost stack. But that's not specific to modals.
Maybe I need better coffee to catch up with what you're saying.
Maybe I need better coffee to catch up with what you're saying.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- VIP Livecode Opensource Backer
- Posts: 9663
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Answer function
Just to throw a monkey wrench into the mix.
The "mouseMove" message is sent while a modal dialog is open, but ONLY when the cursor leaves the dialog. On a new card with a button and a field. in the button script:
in the card script:
Open the answer dialog. Now move the cursor in and out of the dialog. I t does not matter if the dialog is far away form the card. A new number appears in fld 1 each time the "MouseLeaveFromDialogInvokesMouseMoveOnce" message is sent. By the way, I could not find this message in the dictionary. Is it undocumented?
Now, then, change the card script to:
Open the dialog, and you will find that if you move the cursor out of the card window and into the dialog window, one random number is generated into fld 1. If you only simply leave the card window, nothing. If you just leave the dialog window, nothing. You have to leave the card window and then enter the dialog window to invoke the "mouseLeaveButOnlywhenLaterEnteringAnaswerDialog" message.
I could not find this one either.
How many other messages, however distorted in their action, likely each with its own pecadillos, are associated with an open dialog?
Craig
The "mouseMove" message is sent while a modal dialog is open, but ONLY when the cursor leaves the dialog. On a new card with a button and a field. in the button script:
Code: Select all
on mouseUp,
answer "ff"
end mouseUp
Code: Select all
on mouseMove
put random(99999) into fld 1
end mouseMove
Now, then, change the card script to:
Code: Select all
on mouseLeave
put random(99999) into fld 1
end mouseLeave
I could not find this one either.
How many other messages, however distorted in their action, likely each with its own pecadillos, are associated with an open dialog?
Craig
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: Answer function
Craig- mouseLeave is necessary for the functioning of the ecosystem. You may find the cursor changes when over a stack etc.
And if you trap the mouseMove message in a library stack you'll see it's in use within a modal dialog as well. Again, it's necessary for the functioning of the system as a whole, i.e., you'd want to cursor to move when you move the mouse, and you shouldn't need to write code to handle that in each modal dialog script.
And if you trap the mouseMove message in a library stack you'll see it's in use within a modal dialog as well. Again, it's necessary for the functioning of the system as a whole, i.e., you'd want to cursor to move when you move the mouse, and you shouldn't need to write code to handle that in each modal dialog script.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
-
- VIP Livecode Opensource Backer
- Posts: 9837
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Answer function
I would imagine all of them except those needed to maintain the modality of the dialog.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- VIP Livecode Opensource Backer
- Posts: 9663
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Answer function
Richard. I understood this from earlier.
But there are no stacksInUse in my example. The "messages", such as they are, live entirely within a card and the dialog stack itself.
Or did I miss the fact that a stackInUse (library stack) was necessary to see the oddities of the last five pages?
Craig
But there are no stacksInUse in my example. The "messages", such as they are, live entirely within a card and the dialog stack itself.
Or did I miss the fact that a stackInUse (library stack) was necessary to see the oddities of the last five pages?
Craig
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: Answer function
Craig- yes, that's the whole point of this topic.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
Re: Answer function
Yep that did it...
Not sure i understand why putting the same mouseDown code in the parent stack doesn't trigger the same issue, it's only for the stack you've set to 'start using' -- can't quite get my head around the message path there. But certainly proves your point about the answer dialog 'leaking'.