I have the same problem…
I check the jucedemo and I think I did the same things…
but it doesn’t work in my project… :evil:
Some not trivial things needed… as “juce_UseDebuggingNewOperator”?
thanx!
I found a solution… maybe I haven’t really understood the idea BUT…
if you use a Class that is a Component, a MenuBarModel and a ApplicationCommandTarget and…
in your DocumentWindow class you do:
[quote=“giogio”]I found a solution… maybe I haven’t really understood the idea BUT…
if you use a Class that is a Component, a MenuBarModel and a ApplicationCommandTarget and…
in your DocumentWindow class you do:
any component, or class that wants to receive application command events must:
a) be a descendant of ApplicationCommandTarget.
b) be registered by a call to ApplicationCommandManager::registerAllCommandsForTarget()
Then you need to give some thought to how your event will trickle up to the target. If the target is a focussed component, you’re fine. Otherwise, you might need to do something clever in a parent component to endure that the command callback reaches the desired target.
[quote=“valley”]any component, or class that wants to receive application command events must:
a) be a descendant of ApplicationCommandTarget.
b) be registered by a call to ApplicationCommandManager::registerAllCommandsForTarget()
Then you need to give some thought to how your event will trickle up to the target. If the target is a focussed component, you’re fine. Otherwise, you might need to do something clever in a parent component to endure that the command callback reaches the desired target.[/quote]
I’ve done A and B.
The menu is coming from the component, not the main window. The reason for doing that is so I can keep all button control code in the same place. I was trying to follow the demo and it just doesn’t seem to be working.
Can you read the code I posted and maybe spot the problem?
this for ALL the command, even About… if you try compiling in Debug
mode your code (Multi-threaded Debug (/MTd)) you will understand why nothing happened…
no info for the commands --> no commands!
bye!