title: How to programmatically create a dojox.mobile.TabBar?
body: <p>I want to create a dojox.mobile.TabBar of the segmented control type, like the one at the top of this page:</p>
  
  <p><a href="http://download.dojotoolkit.org/release-1.6.0/dojo-release-1.6.0/dojox/mobile/tests/test_iPhone-TabBar.html" rel="nofollow">http://download.dojotoolkit.org/release-1.6.0/dojo-release-1.6.0/dojox/mobile/tests/test_iPhone-TabBar.html</a></p>
  
  <p>Looking at the source, I can see how to do it declaratively:</p>
  
  <pre><code>   &lt;ul dojoType="dojox.mobile.TabBar" barType="segmentedControl"&gt;
     &lt;li dojoType="dojox.mobile.TabBarButton" icon1="images/tab-icon-16.png" icon2="images/tab-icon-16h.png" moveTo="view1" selected="true"&gt;New&lt;/li&gt;
     &lt;li dojoType="dojox.mobile.TabBarButton" icon1="images/tab-icon-15.png" icon2="images/tab-icon-15h.png" moveTo="view2"&gt;What's Hot&lt;/li&gt;
      &lt;li dojoType="dojox.mobile.TabBarButton" icon1="images/tab-icon-10.png" icon2="images/tab-icon-10h.png" moveTo="view3"&gt;Genius&lt;/li&gt;
      &lt;/ul&gt;
  </code></pre>
  
  <p>But I have been unable to figure out how to do the same programatically.
  TabBar is new in Dojo 1.6, but is covered in the documentation at <a href="http://dojotoolkit.org/api/1.6/dojox/mobile/TabBar" rel="nofollow">http://dojotoolkit.org/api/1.6/dojox/mobile/TabBar</a></p>
  
  <p>But my newbie self is still clueless as how to programatically create the TabBarButtons and associate them with a TabBar.  I can find multiple examples on the web that show how to do it declaratively, but not programmatically.</p>
  
  <p>Anyone know of any programmatic examples, or could supply one here?</p>