Use menu bar to open file



I'm a new jucer.I'm plan to do a open source project. Use juce as UI library.

In my project.

MainMenuBar is inherits MenuBarModel ...,Then Add this menu instance to MainWinow  instance which is inherit DocumentWindow and add to Application.

When i click menu bar item file->open, then chose a file and get the file path name.

I need to show this file's content in MainWinow->MainComponent->ShowFileComponent instance.

How to pass this file path name to ShowFileComponent instance convenient?

If i need to pass this file path name to Appliction->MainWindow->Maincomponent->ShowFileComponent ?


I don't think I quite understand all your question.  Do you have a FileChooser or something in one Component and you need to send a message, or call a function in another object when the user selects a file?


Yes,It is.

I want to call ShowFileComponent.setFileAndShow(String FilePathName) when selected a file.