View Single Post
Old 04-03-2020, 07:52 AM   #1008
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 3,451
Default

Quote:
Originally Posted by _Stevie_ View Post
I messed around a bit and I could get it working by putting the reaper.UpdateArrange()
just below first_x = x. But it's doing a lot of flickering here in Windows.

Thanks! I had tried this too and noticed the flickering.



Quote:
Originally Posted by juliansader View Post
You can use JS_Window_InvalidateRect to ask REAPER to re-draw part of a window, which will cover up the previous cycle's line.

For example, try adding this directly after the ReleaseDC line:
Code:
if prev_x and prev_x ~= x then reaper.JS_Window_InvalidateRect(trackview, prev_x, prev_top_y, prev_x+1, prev_bottom_y, true)
prev_x, prev_top_y, prev_bottom_y = x, y+1, y+height-1
Here on my system, this works without any flickering.

Thanks! It works!


Another question:
How can one intercept left mouse clicks on the trackview window? This doesn't work:
Code:
reaper.JS_VKeys_Intercept( 0x01, 1 )
This worked:
Code:
 reaper.JS_WindowMessage_Intercept( trackview, "WM_LBUTTONDOWN", false )
But how can I stop the interception after the script finishes? Because I am left with a non-working left-click!
__________________
Most of my scripts can be found in ReaPack.
If you find them useful, a donation would be greatly appreciated! Thank you! :)

Last edited by amagalma; 04-03-2020 at 07:59 AM.
amagalma is offline   Reply With Quote