title: JUCE - Member Function Not Viable: 'this' Argument Has Type const
body: <p>I'm trying to create a tabbed window by reading from a ValueTree in JUCE.</p>
  
  <p>I'm using the below code to set the corresponding tab's root item to a child of the tree (full code available <a href="https://gist.github.com/J-Bledsoe/c83ddfa9e9f9c3a03c57bbb8626c9a94" rel="nofollow noreferrer">here</a>). However, I get the error:</p>
  
  <blockquote>
    <p>"Member function 'getValueTree' not viable: 'this' argument has type 'const GlobalValueTree', but function is not marked const".</p>
  </blockquote>
  
  <p>I am using an object as the tree returned by <code>getValueTree()</code> or the function itself are non-static.</p>
  
  <pre><code>AccelerometerPage (const DataSelectorWindow&amp; w)
  {
      tree.setRootItem (rootItem = new const OscValueTreeItem
      (w.valueTree.getValueTree()-&gt;getChildWithName ("AccData")));
  }
  </code></pre>
  
  <p>Can somebody point me in the right direction as to why this is incorrect and how to go about fixing it? </p>