SOLUTION -->
click here (It's already built-in, no need for a script)
------------------------------------------
I want to register a menu using .py fu
like I know about <Image>/ and <Gradients>/
But what if i want to register one under Gradient Editor while user has a gradient segment selected.
basically I want to be able to add a function called "Add Stop" or something similar
that it'll
1) add split segment at midpoint
2) set right color of left segment to a chosen color
3) set left color of right segment to same chosen color...
as like a short cut instead of having to manually do 3 steps.
I think this will make the gradient editor much friendlier
I am guessing that gradient and segment is automatically passed in some how ...
like if I register <Gradients>/ it shows up when right clicking gradient and that gradient is automatically passed into the first parameter if parameter is defined as string.... so I hoping when user right clicks the segment, if i had my menu registered in the right place with the right string inside <> ... the gradient and segment is passed in somehow
does any one know? any pointers would be much appreciated.