Layout Error, Function "txt" not found!

Posted on
  • I'm seeing a similar error to that described in RaoulDuke's post.

    When I enter sample code from the layout tutorial:

    var Layout = require("Layout");
    var layout = new Layout( {
      type:"txt", font:"6x8", label:"Hello World"
    });
    g.clear();
    layout.render();
    

    I get the following error:

    >Uncaught Error: Function "txt" not found!
     at line 2 col 373
    ...c)h[k.type](k)})}};h[d.type](d)
                                  ^
    in function "layout" called from line 4 col 152
    ...ct.h-f.h>>1));this.layout(f)
                                  ^
    in function "update" called from line 1 col 203
    ....updateNeeded&&this.update();var b=g,f={"":function(){},txt:...
                                  ^
    in function "render" called from line 1 col 15
    layout.render();
                  ^
    

    with version 2v16.1 (both on the emulator and my BangleJS 2). I've turned off "Shorten variable names" in the emulator as suggested by the earlier post.

    If I run it as an application a 2nd time on the device, it works as expected. What is different?

  • Same here, "txt" does not seem to work anymore outside a horizontal or vertical container, this works:

    var Layout = require("Layout");
    var layout = new Layout( {
      type:"v",
      c: [
        {type:"txt", font:"6x8", label:"Hello World"}
        ]
    });
    g.clear();
    layout.render();
    
  • Ahh - sorry about that. I did a few speed optimisations and it seems the broke the case where h or v layout wasn't the root element. I've fixed it in the development app loader, and next update it'll go live to the banglejs.com/apps

  • Thanks Gordon!

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Layout Error, Function "txt" not found!

Posted by Avatar for gdisalvo @gdisalvo

Actions