Interfacing With Rightclick
Info
In osl, the right click menu can be incredibly powerful in your guis and apps
The base command for a right click is:
Defining a custom menu
You can define a custom right click menu layout using an array and passing it as data
Example of a right clickable square
The right click command essentially makes the previously rendered ui object rightclickable, heres an example
Submenus in right click
You are also able to create submenus using the right click system:
Run custom commands from any right click option
you might be wondering, what's the point in this if i cant use it to run any code?
Well, any item of an array can be turned into an object, as shown below
this menu looks no different to the one from before, except for one change, it has an object and a command designated as linked to the first item in the right click menu.
Now, with these changes, the code above will log hello world whenever we click on the first option of the right click menu.
you can only use a defined command with this system, it cannot be a built in one
Last updated