How to create a dialog window

Hello,
I want to open a dialog window from the main window when I click some buttons or select items in combox etc
That dialog window should contain buttons, sliders, comboboxes etc inside as child

DocumentWindow does not like to contain buttons, texteditors etc as childs
Also, simple Component does not have background window (it is transparent)

So, how to create and open a modal or modeless dialog window in JUCE API?

Thanks

You need to first put those children into a plain Component and then use that as the content component for the window.

1 Like

Hello, Xenakios

When I put that component (containing buttons etc) inside a DocumentWindow
there is a altert message, which says don’t put child in the DocumentWindow (when debugging)

Could you please show me simple source code or web link about
how to code what you are now saying (put those children into a plain Component and then use that as the content component for the window) ?

Thank you

Don’t use addAndMakeVisible or similar to add the child component(s), you need to use setContentOwned or setContentNonOwned.

1 Like

Hello,
I understand now. I solved this issue
I also find the link below

Interacting with DocumentWindow from ContentComponent - General JUCE discussion - JUCE

So thank you so much. I saved a lot of time by your help
See you again