View Single Post
Old 07-27-2017, 10:06 AM   #33
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 4,813
Default

Quote:
Originally Posted by Lokasenna View Post
You can do that easily yourself by rewriting the appropriate method for whichever element you want. i.e:

Code:
--Load all the classes

GUI.New("mnu_mymenu", "Menubox", ...whatever the Menubox params are...)

function GUI.elms.mnu_mymenu:onmouseup()

  -- Run the existing code for the menu
  -- This could be after your extra code instead if you want
  GUI.Menubox.onmouseup(self)

  DoMyStuff(self.retval)

end
Or, if you need to do that with multiple elements, you can easily create a new class based on Menubox and rewrite the method for that:

Code:
-- Load all your libraries

GUI.MyMenuBox = GUI.Menubox

function GUI.MyMenuBox:onmouseup()

  -- As above

end
See the example scripts for an, er, example of this in action. The code/formatting above might not be correct.

Back to this! awesome
deeb is online now   Reply With Quote