]> git.mxchange.org Git - flightgear.git/commitdiff
let foo.getAttribute("listeners") return the number of listeners attached
authormfranz <mfranz>
Mon, 7 May 2007 14:23:56 +0000 (14:23 +0000)
committermfranz <mfranz>
Mon, 7 May 2007 14:23:56 +0000 (14:23 +0000)
to props.Node foo  (shall be used in debug.nas and possibly props.nas)

src/Scripting/nasal-props.cxx

index 77c74a830b3b2042c77981cd943c2ee4f526f8a1..87afb1d93160d2c28ecf7cac0612d71249f011b7 100644 (file)
@@ -83,6 +83,7 @@ static naRef f_getAttribute(naContext c, naRef me, int argc, naRef* args)
     SGPropertyNode::Attribute attr;
     if(!a) a = "";
     if(!strcmp(a, "children"))         return naNum((*node)->nChildren());
+    else if(!strcmp(a, "listeners"))   return naNum((*node)->nListeners());
     else if(!strcmp(a, "tied"))        return naNum((*node)->isTied());
     else if(!strcmp(a, "alias"))       return naNum((*node)->isAlias());
     else if(!strcmp(a, "read"))        attr = SGPropertyNode::READ;