Potential Bug

fairesigneaumachiniste's icon

Unless I am doing something really stupid or this is intended behaviour, I have a bug. In the patch below, if there is text entered in the text field then the patch is closed by pressing cancel (using wclose), the text is still triggered - though if you look at the patch there is no reason why this should be.

This only works if you change the text in the text field.

Max Patch
Copy patch and select New From Clipboard in Max.

I tried all sorts of workarounds using gates, text objects etc and I always get the same behaviour.

Mac OS X 10.5.5 / Intel iMac
Max 5.0.5

Luke Hall's icon

Try storing the output in [zl reg] and using the "OK" message to trigger it.

lh

Max Patch
Copy patch and select New From Clipboard in Max.

fairesigneaumachiniste's icon

Thanks. That works great. Can anyone explain why it behaves the way it does though? It doesn't seem to make sense to me.

Luke Hall's icon

It seems that [textedit] sends out it's contents when it is deselected but the [zl reg] workaround is simple enough.

lh

gusanomaxlist's icon

I think that it would be nice to have this "ouput-on-lost-focus" as an
option ;)

Here is another workaround that will keep the old text if you click on
cancel
(as [dialog] object does ;)

Ciao

Max Patch
Copy patch and select New From Clipboard in Max.

fairesigneaumachiniste's icon

So, I looked at all your methods, including what Stefan did in the other thread. On their own these work well, but weirdly I still get it outputting text in this patch which is essentially the same only with a bit of eye candy and some customisability (real word?).

When the dialogbox/patch opens with a bang the gate is closed. If the text box is defocused then nothing should get through because the gate is closed. Clicking cancel sends a 0 to the left inlet of gate anyway so even if it was open it should still be closed when the wclose message is sent to this patcher.

In fact, the only time the gate is open is if the OK button is clicked and then after the text is sent it's closed again.

Yet if I still type some different text in and press cancel the text is output, seemingly through a closed gate.

Am I going mad?

Here's a test patch and I have attached the abstraction.

Max Patch
Copy patch and select New From Clipboard in Max.

P.s. If you can get it working then feel free to use it. I also have matching warning and confirm boxes if you want - these actually work. ;)