From 28025db59a440c1ad59b882b175e668288e22906 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 15 Dec 2009 19:06:25 -0800 Subject: Working prototype. --- dalos.lua | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'dalos.lua') 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) -- cgit v1.2.3