Add tree.OnSelectNode event callback

This commit is contained in:
Kenny Shields 2014-07-05 23:19:33 -04:00
parent 53894a743c
commit f0349fce02
2 changed files with 5 additions and 0 deletions

View File

@ -153,7 +153,11 @@ function newobject:mousepressed(x, y, button)
end
if self.hover and button == "l" then
local onselectnode = self.tree.OnSelectNode
self.tree.selectednode = self
if onselectnode then
onselectnode(self.parent, self)
end
end
end

View File

@ -26,6 +26,7 @@ function newobject:initialize()
self.hbar = false
self.internal = false
self.selectednode = false
self.OnSelectNode = nil
self.children = {}
self.internals = {}