setContentContainer vs setContentOwned?


#1

Hi all,

I’m pretty new to JUCE, but picking it up pretty well. I’m working on some demo stuff now, and notice that ResizableWindow::setContentContainer has been marked as deprecated. The tutorial I see linked to here still uses it:

http://code.google.com/p/juced/wiki/JuceTutorial

So I assumed, OK, that’s fine, I’ll just look at the latest method in the documentation. But the documentation only still has setContentContainer in it:

http://www.rawmaterialsoftware.com/juce/api/classResizableWindow.html

Is there a newer version of the documentation that contains information on how to use the new method? Or am I supposed to delve into juce_amalgamated.h and see for myself how it’s defined?

Thanks, much appreciated.


#2

From juce_ResizableWindow.h:

    /** Destructor.
        If a content component has been set with setContentOwned(), it will be deleted.
    */
        @param newContentComponent  the new component to use - this component will be deleted when it's
                                    no longer needed (i.e. when the window is deleted or a new content
                                    component is set for it). To set a component that this window will not
                                    delete, call setContentNonOwned() instead.
        @param newContentComponent  the new component to use - this component will NOT be deleted by this
                                    component, so it's the caller's responsibility to manage its lifetime (it's
                                    ok to delete it while this window is still using it). To set a content
                                    component that the window will delete, call setContentOwned() instead.

#3

OK, so then is the usual approach to just delve into the source and assume that the comments are the best documentation? Or in other words, the documentation on this website is out of date?

Thanks


#4

I’ve never seen the docs on the website :oops:

Just my personal opinion, but the source code is the best form of documentation for me. It’s never out of date. And Jules is pro at making functions and identifiers easy to understand.


#5

The documentation is generated from the source code, so there is no extra info available outside of that, but, imo, it does allow browsing of the API’s…


#6

Alright all, thanks for the help - I downloaded doxygen and just ran it on the JUCE code, works like a charm. Thanks again, all. :slight_smile: