Overflow_thresh_default

Hi guys,

I wrote a pretty simple and small addon that generates various context menu items when a string is highlighted.
The thing is once I exceed the number of 10 items, the menu is then moved to a submenu.
I need to avoid that…
So I’ve read the documentation and found:

// If more than this number of items are added to the context menu, all items
// overflow into a "Jetpack" submenu.
const OVERFLOW_THRESH_DEFAULT = 20;
const OVERFLOW_THRESH_PREF =
"extensions.addon-sdk.context-menu.overflowThreshold";

// The label of the overflow sub-xul:menu.
//
// TODO: Localize this.
const OVERFLOW_MENU_LABEL = "Test";

But when I add that to my code, it has no effect… The addons runs, but whether the value of 20 nor the label Test is kicking in.
I’m pretty new to this, if I’m doing an obvious mistake here please bare with me…

Appreciate any help!

Regards,
David

Oh and I’m using jpm to do so…

Just what did you add to your code? And where? You can’t change the value of OVERFLOW_MENU_LABEL or OVERFLOW_THRESH_DEFAULT - the clue is that they’re declared const. What you can do is set the extensions.addon-sdk.context-menu.overflowThreshold preference and that will be used as your threshold (for everyone!). No need for code. I’m not sure if you can change it on the fly though, might have to experiment with that.

I don’t think there is any way to change the label of the submenu.