Page 1 of 3

Msg box still dicey?

Posted: Fri Nov 01, 2019 5:59 pm
by dunbarx
I know this has been discussed before, that there are peculiarities with msg.

For example, in a card with one button and one editable field, if, in the button script:

Code: Select all

on mouseUp
   focus on fld 1
end mouseUp
I get a blinking cursor in the field. But the same command from msg does nothing at all. Still that sort of behavior? LC 9.04

Craig

Re: Msg box still dicey?

Posted: Fri Nov 01, 2019 6:18 pm
by jmburnod
Hi Craig,
Same result with LC 9,5.0.
In this case LC is smarter than i tought. LC is able to keep the last position of cursor after a click outside field 8)
Best
Jean-Marc

Re: Msg box still dicey?

Posted: Fri Nov 01, 2019 6:53 pm
by dunbarx
Jean-Marc.

That is indeed cool, and actually is mentioned in the dictionary.

Craig

Re: Msg box still dicey?

Posted: Fri Nov 01, 2019 8:17 pm
by bogs
dunbarx wrote:
Fri Nov 01, 2019 5:59 pm
But the same command from msg does nothing at all. Still that sort of behavior? LC 9.04
Well, it does something on 'nix in 9.5, when I run that from the message box, it briefly focuses the field before it ultimately focuses the tools palette :P
ksnip_I need some focus here.png
I just can't seem to focus...

Re: Msg box still dicey?

Posted: Fri Nov 01, 2019 10:48 pm
by [-hh]
@Craig. The message box is set to get focus after issuing a command if it is visible.
So it is a possible way to first hide it in order to loose that 'superior' focus.

Code: Select all

hide msg; focus on fld 2 -- this works
@bogs. The repeated selection of the tools palette is an old unix bug.

Re: Msg box still dicey?

Posted: Fri Nov 01, 2019 11:02 pm
by bogs
[-hh] wrote:
Fri Nov 01, 2019 10:48 pm
@bogs. The repeated selection of the tools palette is an old unix bug.
It could be, but I wasn't able to reproduce it on this box in 6 - 7.x versions of Lc, using 'focus on field 1' from the message box actually put the focus on the field but then returned it to the message box in those versions.

In 2.2, the message box simply reports 'no such object', but doesn't loose focus itself.

In Mc 2.2 (Starter Kit), it simply sets the focus to the field as it might be expected to do.

Re: Msg box still dicey?

Posted: Fri Nov 01, 2019 11:45 pm
by [-hh]
In my wording every LC version < 8.1.10 is "zombie" and every other version < latest (currently 9.0.5/9.5.0) is "old" ;-)

Re: Msg box still dicey?

Posted: Sat Nov 02, 2019 12:55 am
by bogs
Ah I see. In my world view, it runs like this (more or less)
Mc -> RR 2.x_____ my place (current old)
Lc 6.x -> 7.x______pinnacle of stability (current stable)
Lc 8.x ->_________Huh, never saw it do that before (current beta)

* DIsclaimer - YMMV, a watched pot never boils, a bird in the hand is worth 2 in the bush, etc etc etc.

Re: Msg box still dicey?

Posted: Sat Nov 02, 2019 2:10 pm
by richmond62
I think that you will find that putting this in the Message Box works:

Code: Select all

select after fld 1

Re: Msg box still dicey?

Posted: Sun Nov 03, 2019 1:21 am
by dunbarx
Richmond.
select after fld 1
That has always worked. Msg seems to "get" more narrowly defined instructions, like "after", but "focus" is what I was asking about. This because the dictionary says quite clearly what this command should do to a field. Doing so from, say, a button script works just fine.

Craig

Re: Msg box still dicey?

Posted: Sun Nov 03, 2019 2:42 am
by FourthWorld
dunbarx wrote:
Sun Nov 03, 2019 1:21 am
select after fld 1
That has always worked. Msg seems to "get" more narrowly defined instructions, like "after", but "focus" is what I was asking about. This because the dictionary says quite clearly what this command should do to a field. Doing so from, say, a button script works just fine.
A button has no selectable text.

Re: Msg box still dicey?

Posted: Sun Nov 03, 2019 3:20 am
by bogs
Um, he is saying that it works from the script of a button, not from the text of a button heh. Further, since it works from the script of a button, it should then work in the message box, but alas it does not (unless your in Mc like myself).

Re: Msg box still dicey?

Posted: Sun Nov 03, 2019 7:06 am
by FourthWorld
Distinction I was drawing was that the Message Box contains an editable field, and will often refocus itself for further command entry, evidently.

Re: Msg box still dicey?

Posted: Sun Nov 03, 2019 12:46 pm
by bogs
Ah I see, sorry I completely missed that one, but I am a bit under the weather at the moment and a little more obtuse than usual.

It is curious, though, that even though Mc's message box is the same, it doesn't do the same, i.e. return focus to the field issuing the command entry.

In fact, here on 'nix, it doesn't return focus to the message box either, least not on XFCE. Focus ultimately winds up at the tool palette, which of all the choices is the most bizarre. I need to test it out on MATE, since I know 8.x and up give weird results on XFCE anyhow for even the most common place expectations.

As Hermann said, a bug for 'nix, so might it not be a bug all the way around? In other words, something has changed from (what I consider) the expected behavior to the unexpected behavior of either focusing the tool palette or returning focus to the mb on other OS'es. If it is different on 2 OS'es in an environment that is supposed to be the same on all, that sounds bug like.

*Edit - In my previous experiment, I was using the Mc IDE with the Mc engine. To see if it were the engine producing the difference in the result, I switched to Mc IDE + Lc 6.7.11 engine. The result was the same as using the Mc engine ( Field got the focus, not the msgbox), so I can only assume at that point that changes were made in the scripts governing the msgbox field, if Richard's theory is correct.

*Edit 2 - in playing with this across multiple versions/desktops, I've actually come to the conclusion that the way Richard explains it is in fact the way it should be working *because* I can see that the field does get focus after the command executes, so the command itself is working as the dictionary states it should be, but as he points out, when your in the message box, you expect to issue more commands following the one to set focus, unlike when you execute a script from a button, where you expect that the code is (more or less) finalized.

Side edit - In MATE, focus does not switch to the tools palette, testing for me is finished :P

Picture demonstrating that the field *is* actually focused after the command is issued -
ksnip_focusedField.png
It is hard to keep focus....

Re: Msg box still dicey?

Posted: Sun Nov 03, 2019 2:37 pm
by richmond62
That has always worked.
Then the sensible thing might be to use 'that.' :D