Right Click Context Menu 2024
-
What's the current best way to implement right click context menu?
I can get the component under mouse on click, get context items for that component from wherever. Functiality is then... where?
I mean this can probably be a panel that pops up on right click, gets painted based on whatever object I feed it, and has a sizeable mouse function where each item's functionality is described. But am I missing a simpler way to do this?
-
@aaronventure I think a panel is the way to go
-
I would recommend using a broadcaster. The wizard should get you 99% there.
-
@Christoph-Hart Ah looking at it right now.
Found a sizeable example in the docs, too! What a day!
https://docs.hise.audio/scripting/scripting-api/broadcaster/index.html#attachtocontextmenu
-
@aaronventure wow I forgot I wrote that, but that looks awesome. Good me.
-
@Christoph-Hart would it be possible to add an option or change it so that the broadcaster context menu pops up at the position of the mouse click, like it is in all software?
-
@aaronventure yes sensible request, the function even already has a bool parameter to align this to the component or not, but I'm not using it in the broadcaster's context menu yet (the panel's context menus can do this though).