LCObjectPost/Send callback issue with answer dialogs

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, LCMark

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

LCObjectPost/Send callback issue with answer dialogs

Post by monte » Tue Jun 18, 2013 7:07 am

I'm not sure if this is an issue on other platforms but I've just had a fairly long and stressful support request about mergAccessory. I couldn't workout why the callbacks weren't coming in. Then I had an epiphany... the user had answer dialogs everywhere instead of put or some other log so I got rid of them and all of a sudden the messages were coming in. Should I just put this in the good to know box or can we fix it and queue messages until the answer dialog is dismissed.
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1207
Joined: Thu Apr 11, 2013 11:27 am

Re: LCObjectPost/Send callback issue with answer dialogs

Post by LCMark » Tue Jun 18, 2013 8:46 am

@monte: The answer dialogs (on mobile - just like desktop) essentially do a dispatching wait while the answer dialog is on screen. This means the messages should be being dispatched... However, you can't nest answer dialogs on iOS - if you call answer while one is displayed, the second request will return 'cancel' straight away. Thus I'm not clear from your description exactly what is happening - is it the callbacks weren't being dispatched, or that the answer dialogs in them (assuming that's where they were) weren't being shown? (because one was shown already).

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: LCObjectPost/Send callback issue with answer dialogs

Post by monte » Tue Jun 18, 2013 8:52 am

Ah.. It could be the latter... There was lots of answer dialogging ...
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: LCObjectPost/Send callback issue with answer dialogs

Post by monte » Wed Jun 19, 2013 4:21 am

Thinking about this some more... wouldn't having the handler wait with messages until the first answer dialog is dismissed be more robust? I think this is only going to be an issue for callbacks or send in time stuff but just cancelling out on subsequent dialogs could easily introduce some quirks into an app...
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1207
Joined: Thu Apr 11, 2013 11:27 am

Re: LCObjectPost/Send callback issue with answer dialogs

Post by LCMark » Wed Jun 19, 2013 9:24 am

The answer command does already work like that (MCScreenDC::popupanswerdialog). It shows the dialog, then does a dispatching-wait until the user clicks on it. The key here is that it is a 'dispatching' wait - meaning that messages are dispatched during the wait (which is the same on desktop). So, in this case, the answer dialog is being shown, then a message is arriving that pops up another answer dialog but the latter fails because one is already on screen.

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: LCObjectPost/Send callback issue with answer dialogs

Post by monte » Wed Jun 19, 2013 9:30 am

right, what I'm suggesting is the second answer command should behave like it has "wait until answer dialog 1 is done with messages" just before it... rather than cancelling out immediately. I think that would be closer to user expectations.
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

DarScott
Posts: 227
Joined: Fri Jul 28, 2006 12:23 am
Location: Albuquerque
Contact:

Re: LCObjectPost/Send callback issue with answer dialogs

Post by DarScott » Wed Jun 19, 2013 5:51 pm

answer ... with no messages

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Location: Aalst, Belgium
Contact:

Re: LCObjectPost/Send callback issue with answer dialogs

Post by Janschenkel » Wed Jun 19, 2013 8:22 pm

Shouldn't that be

Code: Select all

answer ... without messages
instead? ;-)

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

DarScott
Posts: 227
Joined: Fri Jul 28, 2006 12:23 am
Location: Albuquerque
Contact:

Re: LCObjectPost/Send callback issue with answer dialogs

Post by DarScott » Wed Jun 19, 2013 8:32 pm

Yes! It should be consistent with move. And anything else I'm not remembering.

Simple and consistent. Thanks Jan!

Maybe there are commands that need this or should work if this is added.

DarScott
Posts: 227
Joined: Fri Jul 28, 2006 12:23 am
Location: Albuquerque
Contact:

Re: LCObjectPost/Send callback issue with answer dialogs

Post by DarScott » Wed Jun 19, 2013 8:44 pm

Perhaps somebody should say this. I fully recognize there are lots of styles of programming and lots of ways exploring new tools and components. And I know I'm weird in what I do. And I know this sounds patronizing and arrogant. And I know we all take what customers really do very seriously.

Is the use of answer in a callback typical?

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: LCObjectPost/Send callback issue with answer dialogs

Post by monte » Wed Jun 19, 2013 9:09 pm

@DarScott Yes it may be atypical but these things will happen...

@Janschenkel that's an idea but how would it work on desktop where we need messages for the answer dialog stack to function?
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: LCObjectPost/Send callback issue with answer dialogs

Post by mwieder » Wed Jun 19, 2013 9:57 pm

I think this is what Monte is asking, but...

Would "answer without messages" block messages or just queue them up and release them when the answer dialog is dismissed?
I can think of problem scenarios either way.

DarScott
Posts: 227
Joined: Fri Jul 28, 2006 12:23 am
Location: Albuquerque
Contact:

Re: LCObjectPost/Send callback issue with answer dialogs

Post by DarScott » Wed Jun 19, 2013 10:08 pm

This might be related to what I was mentioning in another context. It would be nice to have some blocking support. I am resigned to partial blocking, but it looks like there are cases in which it would be nice if only some messages (those related to the current operation) are processed and others are not.

I'm not sure that we "need" messages for the answer dialog to function on desktop, I think that is an implementation issue. I don't think there is any language feature that depends on it.

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: LCObjectPost/Send callback issue with answer dialogs

Post by monte » Wed Jun 19, 2013 10:57 pm

@DarScott Implementation of the handlers in the answer dialog... how would you implement them without messages?
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

DarScott
Posts: 227
Joined: Fri Jul 28, 2006 12:23 am
Location: Albuquerque
Contact:

Re: LCObjectPost/Send callback issue with answer dialogs

Post by DarScott » Wed Jun 19, 2013 11:25 pm

@monte, I just skimmed over the dictionary entry for answer and I did not notice the word "handler". There is nothing there that requires that answer be implemented in LiveCode.

Now, I think it would be cool if it was. Of course, that is best if some mechanism for blocking is provided. That mechanism, in its simplest form, might be like this:

Code: Select all

lock messages except those for me
...
unlock messages
I don't know if that is really the right form. This should be able to expand to also except all those libraries this depends on. And maybe some others that promise to behave. But, to start with, maybe an explicit list is good.

Then with that "without messages" can be implemented.

And then with the same command, I can add blocking versions to my commands. (Or "without messages" versions.)

Locked

Return to “Engine Contributors”