SetContentOwned and others


I'm not able to manage this.

I have a MainWindow that calls a component that takes entire screen of application. I call it this way:

contentComponent = new ContentComponent();
setContentOwned(contentComponent, false);

and i need when i press a button on this compent to open a new one that will takeover the entire screen of application.

I've made several attempts with AddAndMakeVisible, setContentNonOwned, addChildComponent, but i could not do it. Always crash.

What am I doing wrong, and what is the right way to do it ?


Hi Again,

I'm a desperate man.

On my tests and tests I'm now doing this way:

I have a DialogWindow that is called from the MainComponent.

When i press a button on this DialogWindow, i call in the MainAppWindow (DocumentWindow) a function that does this:


and I close with success the DialogWindow.

But I need to open a new Content Component, and trying to do the normal way:

contentComponent2 = new ContentComponent2();
setContentOwned(contentComponent2, false);

ContentComponent2 is defined as a ScopedPointer<ContentComponent2> contentComponent2 of a Class called ContentComponent2.

It crashes and shows:

ScopedPointer& operator= (ObjectType* const newObjectToTakePossessionOf)
if (object != newObjectToTakePossessionOf)


What am I doing wrong ?

Should I point first to the father Component before calling the setContenOwned ? How can i do that ?

A suggestion or solution was great ! I'm stuck on this and cannot proceed !



Hi all,

I'm stuck, cannot continue my course.

I tried so many times and so many ways, and just cannot proceed.

I've made a simple project that identifies my simple needs (to some people).

All is regarding the situation of components, parents and childrens.

Structure is like this:

MainComponent -> Open Frontpage Component

Frontpage Component -> Open Dialog Window -> Open Dialog Windows can return to FrontPage Component or Open a Component called

                                                                              -> Open directly a component FirstComponent


First Component -> Open a Child Window or can return to Frontpage component

                            -> Child Window can return to First Component or return to FrontPage Component.


The example project is downloadble on:

Please, help me solving this riddle.