thispatcher and mousestate : when is my patcher window size changed ?
I just wanted to find a simple way to know exactly when my patcher window size is changed, in order to resize the lcd that is in it.
I need to test the window size (with the msg "window getsize" sended to [thispatcher]) when the mouse button is released, but [mousestate] doesn’t report the button events when i click on the window zoom corner, or the titlebar, or elsewhere outside a patcher. It looks like [mousestate] only report the button pressed when I click inside one of the patchers opened.
How can i do ?
Any other way to get the new window coordinates when changed ?
is that work on your computer ?
----------begin_max5_patcher---------- 1355.3oc6ZEsiahCE84juBV5qYFgw1PxtOs+.qz9bU0HGvSF2RLQfSlosp+6 qACIXBj3PRX7rpJRPvXrOb3ds88b8OmNwcY5azbWm+z4yNSl7yoSlTVTQASp tdh6ZxaQIj7xp4xoult7qtyT2RPeSTV7l5R3aWmtUjPEkUGTU5FhH5EFe0SY zHgp6PdO5Mywed4Ir5B3idNeo5QTsh36anp565t+VOmxE4reTdC.R9jphiRS RyTU16w49gHLXl7egvPeLt3eygX+EnYNfFciDuLda3VzAbx5xNv8uyXjj5WO VbYYRJ3g4tMe4nYUjVEqIaDVBcGMKmkxaz1SbOPA93h25fEEGgdkWfBPG.m7 awpjznuQK6Tu5BioOeIsQ5FJ+P8KIZsC50jw2jQyobAQTA7l8KYah3otoe86 +LIh16C2I0NwcUFKNkW.Bsmrn35tS99prTzvcYM3jMc7vhzzjkjrcrb1xDp1 2AocNgyVSDTASgGeu8OGa8lLFWn0VTNQ1FujGkkljn0Tp6rqi6DS2whnuxhE uT1VGXKMOuF1MZdfZk2xST4fTydG66403N85+g7T7It93dVsOmi1tA3lHHJc 8Zph1bcqK9WSmV+mYC7cUaTmVi7Ph9V+j.vDR.5UwEsGD5LCDchAiNl97a8L c6DzhbgiDIFkv13.vdxAh8FLYBpHP0o4A2S1DND1DLRr4CEVTWMMVYT5aFMV NX0nYWFLZLI5JXxO.DI5ijCts6e6OVS4jQkqyH1QihJryb.WM6BqMZQ2S5EL D5MbrF+7Od3ZG7DDnHS+Gw1mOeXf8yieDnQ7HQia4EqwzwS8qeJEYDkplMB. glOczrtNMd98fa53pkf4JsKQmJnkyLDoFe30io0kDSyg3PSX79Boq7Uo39cy P4oayhpwqZAVxXy0vcLMWv36iJ+y0Kosc8dgEGqGDb4m.V7lToYSE7b9hQeQ uTTCLD0PY8.VCpQFhZeqhq8u.t1dPcno101EYGZp+XfcAargvFYWCiT7wGZ. rK+r.rKbCLE2VFe6aBtw1Ge6YJtsG9FZJrsqY2CMc58aIaWUnD+pjsjS1Qie R1KxkD9DQHxXK2JTq5pYxWNWtJVkjtjjTk4l8qBdepH5LEFCJuGmHeGmHkHS OvBkGUe9dGxOWU3JH34yO2RBekskitPzMMIc.zBUHGKFdR55tM9cR59+YR5N grBBmkWq7LUwAanRrZNn2eYCvik11wzDx2cfWqxq.0VQH.duYyAo1EdrREnj 2xkypK835mOwmlO80T5xy6JU5ZzE7BOVIRXMUjkJmJXvVtJlVoRaPfUZ3J8K sF0COLuj4pGdjomQBH5OF6JhaxN.w2+Z2AHgv2c4RwlF4M1tT5.aZj2VFtCM V8QO6JxaOSCg0tzeDarjA1kbuXS0VGC+slAuaZFrgvoIcKPfW+BD3qs9N.9v o8AtubkV79A.bv7fh3YwEA4WF4esF.Mi2eYZVLMS6Q6Kd3t0Fn4NUJz81ohx ORbxSjgJ532Ma4e1s6b0B1PFrcmmYvVdtqkmYlxH.3MjWHQB1N5.kXRs5UT3 4ojlKEyHFw6RXD7PHj0z7bxJ5QLxqLdb5qNqnJLNPw2p0fSs1LvUs63Gtoxs zRQ7BKuVJtg4BUEld3h6gKzEItHvsw7KUc4m9mhNU6szw8uJN7o+s3HkGqJQ MGUEoVhQ80Cq331y2VwzGOOayYO6aoAZyEe7zqcO05Qe1MERs5NCRN8cGR.C PDXbgDzDHMtjj1lynGHMeTgzbCHofvKCRnEE6oMHBqV0R3wWgmqDKXQ8EsbY m9qo+G.zA9+K -----------end_max5_patcher-----------
curious ; i still don’t understand how is it working on mine ;-)
Well, thanks, this way of doing is also working here. But your way of doing is fine until you a bit more of your cpu… i don’t want to resize the lcd every 25 ms for nothing, with my sound going on…
So what i want is the state of the mouse BUTTON, the 1st outlet of [mousestate], which do not work while clicking somewhere else than inside the max patcher. This 1st outlet of [mousestate] is doing nothing when i grow the window.
Is’nt there a way to get the mouse buttons info when the mouse click outside max ?
I have not benchmark the process ; but IMHO you don’t have to care about just one [moustate] one [delay] and one [trigger] even if you are banging them every 25 ms …
if you really care about CPU don’t use [lcd] ;-)
Anyway : perhaps [ol.mousewheel] from Oli Larkin ? my memory is not good ; but i think you can track mouse click with it …
about the cpu, i don’t care about [mousestate] every 25ms, but about the "window getsize" msg sended to [thispatcher] every 25ms, (msg to test if the window size have changed), plus i just don’t like this way of programming, to have useless messages sended everytime, everywhere, after it’s a mess, and then your sound is not working right, and you can’t figure out why…
I feel something might be missing in [thispatcher], it would have been nice that it output some msg when the window size is modified.
Anyway, i’m sending "window getsize" every 1000ms (and only while my sound is off), not elegant, but working.
Thanks for the Oli Larkin’s external notice, I remember i tried this and it was working before on my MBP, but now it’s not. strange.
Guess, you know what ?
After an hour of sending "window getsize" every second to [thispatcher], the "save" button in mac os window started to "twinkle", and some part of the mac os saving window too!… so i stopped this "window getsize", and guess what, suddenly my system is not twinkling anymore…
This "window getsize" every second is clearly not a solution.
I don’t find any solution..
oops : i have a look on [ol.mousewheel] ; it doesn’t track click button …
"… but about the "window getsize" msg sended to [thispatcher] every 25ms …"
on my computer, it bangs ONLY when you resize the window …
----------begin_max5_patcher---------- 800.3oc0X0sbiBBE9ZySgCWmsiA0j18t84nSmLndZB6hfiRRa2N8ceQPihAS rYSmM6Mfd3uuyGme.delGJQ7JTg7+t+i9dduOyySKpVfWy+dnbxqoLRktanj cRofilaZhuKmxYfT21hNghcxgRMhjuU.lkCkP3aP9O0zbAQltkx2rtDRkldD EbWvb+EXcUW4ggPyzHRj7yugQ0h9X1r5h4STU3vKpw1pJR3U85hJt.k6YAWV Q+sV0VDoP5emNeutLJTqxg8T4TASTZ5Yvc2iWEEuXt5qUgqvww0eceXL9gHE q4lmVEg5gXNIWCLzOJoDFpOpfxFhqg4TCfxf8PYEUs62o4dnNriiqw6xGz6Z Q5Jb7Cc.QsergIR+EnwSPqvL34OybHJ.dW+0DkUgcOo7hRnB3RhrA38WWxNl bs68N61eljBiNXmznGZSIMSvqAg0HqE2tbO5vrtoGbRgiAKEBVBobOshlv.q 8AksNgSyIRPRM3AGbXbz7hRJWZMW.mnlisUokBFyZpLsr2QKYvdZJ7BMStUO WcrkUfjd1MVdgVxOk2nsGozOoubW9ki6adB+yI3idlXSlJ7xgNpC86hiPCPy .il1F0gvLeL+5SjY.i7leXvnrI9eJaZB6sL7rrY3MAapnmJnREYAt.qy3KjO q8hmehpyQ0l.NKB5WcRtFeav0frTnREbqY4ZnyklxyFFv1y6qkL0TynzUvjn KmVeSiRZJiaKGiRVYYekJxyASdJz0jLLJxE3lFLk.W3IqrgeFks6DALJerjq ZPU2taVnRrqLsc2q0e1egE.yTAwn7CGP5wtTV91ZxVZVl8ARzDMMqPnLLZ.n +SSZe6hvM9+ObWaeO.NtwccrgaHb6.Niv23aK6jvIh6Ug2V3NZp780D2MBUJ f4teUj8P1Z0xnhvslHkkT088Mgd5eWP003RHrlKJdHE1ga937FSeUWy5bWia rrrFV357jAjTIcO37cCBtJuaP+7timGpob0QOaP+yychG.nGgnGpcdGC+Lzt tgkNNtmk87H1xVgNN1L1sI7QaYSERwS.QCf8mCRpe9X1e.+lNfO -----------end_max5_patcher-----------
How it works :
----------begin_max5_patcher---------- 1187.3oc6ZssjhqBE8Y8qfJO63AHId4717czUWcgInxbhPpDhc2mol+8CART PSFwKsUlpNu.JWRVr1qMaHvOGOJXk3CZY.3uAu.FM5miGMRWTcAiZ9+nfcjO RxHk5lEvouKV8ifIlpjzOj5hyaKgWsiwynRcqQGKTTIOsz0Btrj8uTcYQSgM EaZo7ybpAWAqH7MAfWapNmHS1x3adqflHMsHBp5LXgNMJrNEqROziDQlnvzR 3zE34QwnIpeMObNNNt9WKBiwKil.PVchkpGWpw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YsFm3+7hCg71acXMKCx2.ngCK20XewM5QpSZJTM.L mZbIYOM8M0qQsxu2HRYAaUkzrjL6SQdSlXEIq4HlOrz9CmWZmmy5W0gydoC+ suceXXAcpw94ykMPwFRk035uZA25cH.gs2kAr66C.N3FFJ8buIHIR1dZmiP3 C4xSXu0p9G2MoyO6tSzwQv0mItgPzc0cqEF94TWzFV5bWSaGt97JcazYdjc6 MdlIyWHg7AS36.Rp+7qw+GffbPsO -----------end_max5_patcher-----------
Wow, that’s a f*** weird way of doing, and it seem to work!.. But the problem again is that when lot’s of audio and drawing is going to be on, plus when i’ll share my patch with a friend on an other computer, then your 80 ms limit on your last patch will not react the same way, and then, either my lcd wont resize, or this "window getsize" is going to be sent all the time. And I’m not gonna spend my time adjusting this delay, just for a resize option that i will use episodically.
Anyway, I even didn’t think about using [active], and as my LCDs are mostly for display only, what i will do is to bring another patcher window to front after 5 seconds… ("window getsize" sent every second during theses 5 seconds)
I want to say again,
as feature request,
(anyone at C74 working in august and reading this?),
that it would be really welcome that [thispatcher] output some msg when the patcher window size have been modified.
you are right, it’s a little bit bizarre and not very fun if you want to share patches ; and that’s true it should be nice to have an external doing that … maybe something to do ;-)
Hey, nobody have done it before ?
i did it quickly ; i hope there is no bug ; waiting for cycling74 …
"… that it would be really welcome that [thispatcher] output some msg when the patcher window size have been modified …"
Well, thanks for this external pizza olives !
what about using [hi]?
> what about using [hi]?
i tried [hi] but it does not output anything from my Spyker mouse.
Thanks Pizza Olives for the object. Works well!
Do you think that there is a way to know when the window has been moved?
I want to be able to store the new position only in this case.
A dedicated object would be great.
For cycling guis, here is another wish for christmas…
knowing when the window have moved isn’t so easy to code ;
i had a quick look this morning : no idea how to do it, sorry ;
i’ll ask in the "Dev" forum maybe …
ok, so after few investigations it seems not possible with SDK ; so maybe just ask window size to [thispatcher] when you close the window with [closebang] or [freebang] (or maybe [active]) if you don’t want to connect directly a [metro] to it … i think that most of time native object are best to use for crashproof optimizations.
Hi Pizza olives,
Yes, in fact… I saw the discussion with Emmanuel on the DEV forum!
Getting the window size with [closebang] or even [freebang], is sometime to late in order to write the window position in a file. [Active] can be a solution but not in all the cases… And [metro] is really not the good choice to spy a window position.
A dynamic [thispatcher] would really be a good solution for us…
Anyway, thanks a lot for your investigations!
Keep the good work,
adessiatz, a reveire !
I’m curious if anyone has produced a similar object as pizza olives, but for Windows. If so, would you mind sharing? Sending the window getsize message every second is very clumsy and has a noticeable (albeit quite small) CPU impact.
just to say you can find here last version of [quebec] with lock/unlock state report : http://cycling74.com/forums/topic.php?id=28701 …
anyway in both version i include C code sources ; a volunteer for windows compile ;-)