working on bind

This commit is contained in:
Danny Yoo 2011-08-25 22:38:09 -04:00
parent 12a4fca495
commit c60f540685
3 changed files with 34 additions and 1 deletions

View File

@ -35,6 +35,7 @@
view-text
update-view-text
view-bind
view-attr
update-view-attr

View File

@ -174,6 +174,22 @@
});
};
MockView.prototype.bind = function(name, worldF) {
// return new EventHandler('on-tick',
// new TickEventSource(delay),
// onTick);
return this.act(
function(cursor) {
return cursor;
//return cursor.replaceNode($(cursor.node).clone(true).bind(name,
},
function(view) {
return view;
//view.focus.bind...
});
};
//////////////////////////////////////////////////////////////////////
@ -888,5 +904,17 @@
EXPORTS['view-bind'] = makePrimitiveProcedure(
'view-bind',
3,
function(MACHINE) {
var view = checkMockView(MACHINE, 'view-bind', 0);
var name = checkSymbolOrString(MACHINE, 'view-bind', 1).toString();
var worldF = wrapFunction(checkProcedure(MACHINE, 'view-bind', 2));
return view.bind(name, worldF);
});
//////////////////////////////////////////////////////////////////////
}());

View File

@ -59,4 +59,8 @@
(error 'view-attr "Please run in JavaScript context."))
(define (update-view-attr v attr-name value)
(error 'update-view-attr "Please run in JavaScript context."))
(error 'update-view-attr "Please run in JavaScript context."))
(define (view-bind v type worldF)
(error 'view-bind "Please run in JavaScript context."))