View Single Post
Old 07-30-2017, 03:58 PM   #43
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

- When you write your new :onmouseup function, it still has to call the original code for the original behavior to happen - your last example just does the new stuff and nothing else.

- I think the stack overflow error is because you're referring to Menubox from one of the MyMenuBox functions. Lua gets weird sometimes with stuff like that; I don't know why.

Try:
Code:
GUI.MyMenuBox = GUI.MenuBox

-- Just copying the mouseup code so it doesn't get lost
GUI.MyMenuBox.mouse_up(self) = GUI.MyMenuBox.onmouseup

function GUI.MyMenuBox:onmouseup()

  ...your code...

  self:mouse_up

end
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote