title: How to pass a widget name to a function in Tabris?
body: <p>Can I pass the <code>name</code> of the widget to the <code>function</code> to create Tabs?</p>
  
  <p><strong>Something like</strong></p>
  
  <ul>
  <li><code>let widgetName = new Tab({</code> ...</li>
  </ul>
  
  <p><strong>Why?</strong></p>
  
  <ul>
  <li>I need to put many different
  widgets inside of the each <code>tab</code> created, i.e.: <code>.appendTo(tabCart)</code></li>
  </ul>
  
  <p><em>Note:</em>  When I create a function <code>createTextViews()</code> I assign a unique</p>
  
  <p><code>id: txvName +(index)</code></p>
  
  <p>(an <code>array</code> is passed to <code>createTextView()</code>, then a <code>forEach</code> loop)</p>
  
  <p>and can address each <code>TextView</code> by id, which works great.</p>
  
  <blockquote>
    <p>Sample Code: (works on /playground)</p>
  </blockquote>
  
  <pre><code>const {Tab, TabFolder, TextView, ui} = require('tabris')
  
  let tabFolder = new TabFolder({
    left: 0, top: 0, right: 0, bottom: 0
  }).appendTo(ui.contentView)
  
  createTab('tabCart', 'Cart')
  createTab('tabPay', 'Pay')
  createTab('tabStats', 'Stats')
  
  function createTab (widgetName, title) {
  // let widgetName = new Tab({  //fails, can't assign twice, wrong type anyways
    let tab = new Tab({
      title: title
    }).appendTo(tabFolder)
  
    new TextView({
      centerX: 0, centerY: 0,
      text: 'Content of Tab ' + title
    }).appendTo(tab)
  }
  </code></pre>