Canvas ND framework: Difference between revisions

Jump to navigation Jump to search
No edit summary
Line 207: Line 207:
<syntaxhighlight lang="nasal">
<syntaxhighlight lang="nasal">
{
{
  id:'planArcs',
  id:'planArcs', # the name of the symbol in the SVG file
  impl: {
  impl: { # a hash containing callbacks
   init: func(nd,symbol) {},
   init: func(nd,symbol) {}, # required intiialization code
   predicate: func(nd) { nd.in_mode('toggle_display_mode', ['PLAN']) },
   predicate: func(nd) { nd.in_mode('toggle_display_mode', ['PLAN']) }, # the predicate that decides whether the true/false callbacks below will be executed
   is_true: func(nd) { nd.symbols.planArcs.show() },
   is_true: func(nd) { nd.symbols.planArcs.show() }, # this will be invoked if the predicate evaluates to true
   is_false: func(nd) { nd.symbols.planArcs.hide() },
   is_false: func(nd) { nd.symbols.planArcs.hide() }, # and this if it does not
  },
  },
},
},

Navigation menu