From f1cfd691b4de6c1514ae8263a0783c5211d7f3d1 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 5 Jul 2015 10:28:59 -0700 Subject: 1711 - start adding methods to editor-data objects The menu bar needs separate recipes to render and respond to events. --- 037recipe.cc | 10 ++++++---- edit.mu | 4 ++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/037recipe.cc b/037recipe.cc index 2331ce9d..5a4acb82 100644 --- a/037recipe.cc +++ b/037recipe.cc @@ -14,8 +14,8 @@ recipe f [ :(scenario call_variable) recipe main [ - 1:recipe-number <- copy f:recipe - 2:number <- call 1:recipe-number, 34:literal + 1:recipe-ordinal <- copy f:recipe + 2:number <- call 1:recipe-ordinal, 34:literal ] recipe f [ 3:number <- next-ingredient @@ -25,9 +25,11 @@ recipe f [ #? ? :(before "End Mu Types Initialization") +// 'recipe' is a literal Type_ordinal["recipe"] = 0; -type_ordinal recipe_ordinal = Type_ordinal["recipe-number"] = Next_type_ordinal++; -Type[recipe_ordinal].name = "recipe-number"; +// 'recipe-ordinal' is the literal that can store recipe literals +type_ordinal recipe_ordinal = Type_ordinal["recipe-ordinal"] = Next_type_ordinal++; +Type[recipe_ordinal].name = "recipe-ordinal"; :(before "End Reagent-parsing Exceptions") if (r.properties.at(0).second.at(0) == "recipe") { diff --git a/edit.mu b/edit.mu index 51788c0b..b67331c5 100644 --- a/edit.mu +++ b/edit.mu @@ -86,6 +86,10 @@ container editor-data [ # helps organize editors in a 'chain'. next-editor:address:editor-data in-focus?:boolean # set for the one editor in this chain currently being edited + + # functions to run + render:recipe-ordinal # how to render this container + respond:recipe-ordinal # how it reacts to events from the console ] # editor:address, screen:address <- new-editor s:address:array:character, screen:address, top:number, left:number, bottom:number -- cgit 1.4.1-2-gfad0