summaryrefslogtreecommitdiff
path: root/dalos.lua
diff options
context:
space:
mode:
authorunknown <Pixel@.(none)>2009-12-15 19:06:25 -0800
committerunknown <Pixel@.(none)>2009-12-15 19:06:25 -0800
commit28025db59a440c1ad59b882b175e668288e22906 (patch)
tree8952228803dcb39e3117ebb668cdc8a1bdbcbc0b /dalos.lua
parente977437210d18847a404d68dc495dc8f45ecc46a (diff)
Working prototype.
Diffstat (limited to 'dalos.lua')
-rw-r--r--dalos.lua20
1 files changed, 15 insertions, 5 deletions
diff --git a/dalos.lua b/dalos.lua
index 237252c..7a15e7e 100644
--- a/dalos.lua
+++ b/dalos.lua
@@ -439,17 +439,27 @@ function activate_hv(self)
end
function input_change_hv(self, ind)
- self.extra.hv:updatehandle(self.inputs[ind].obj.obj:getoutput(self.inputs[ind].ind))
+ local ni = self.inputs[ind]
+ if ni then
+ local ii = ni.ind
+ local io = ni.obj
+ self.extra.hv:updatehandle(io.obj:get_output(ii))
+ else
+ self.extra.hv:updatehandle(nil)
+ end
end
+hv = iupe.hexview { }
+hvdlg = iup.dialog { iup.hbox{ iup.frame { hv }, iup.sbox { direction = "WEST", iupe.hexview_toolbox { hexview = hv, }, }, }, title = "Hexview" }
+
extra = {
- hv = iupe.hexview { },
- hvdlg = iup.dialog { iup.hbox{ iup.frame { hv }, iup.sbox { direction = "WEST", iupe.hexview_toolbox { hexview = hv, }, }, }, title = "Hexview" }
+ hv = hv,
+ hvdlg = hvdlg,
}
o1 = dalos.object(d, { y = 30, x = 10, noutputs = 1, name = "Buffer 1", otype = dalos.objtype.HANDLE })
-o2 = dalos.object(d, { y = 30, x = 90, noutputs = 1, name = "Buffer 2", otype = dalos.objtype.HANDLE })
-h = dalos.object(d, { y = 120, x = 50, ninputs = 1, name = "Hexview", otype = dalos.objtype.LUA_VIEWER, activate = activate_hv, input_change = input_change_hv }, extra)
+o2 = dalos.object(d, { y = 120, x = 10, noutputs = 1, name = "Buffer 2", otype = dalos.objtype.HANDLE })
+h = dalos.object(d, { y = 60, x = 100, ninputs = 1, name = "Hexview", otype = dalos.objtype.LUA_VIEWER, activate = activate_hv, input_change = input_change_hv }, extra)
o1:set_houtput(b1)
o2:set_houtput(b2)