Adding submenus to custom menus [message #455319] |
Wed, 20 September 2006 16:34  |
Eclipse User |
|
|
|
I added a new menu to the menu bar using the following <menu> tag inside a
<actionSet> tag:
<menu id="tasks"
label="Tasks">
<groupMarker name="top"/>
<separator name="separator"/>
<groupMarker name="context"/>
</menu>
The problem is that I can add Actions to this menu, but not submenus. For
example, the following correctly adds an Action to the above menu:
<action
class="(classname)"
id="(idname)"
label="This menu entry shows up!"
menubarPath="tasks/context"
style="push"/>
But this code does NOT add a submenu to the same menu:
<menu
id="addsubtask"
label="Add Subtask"
path="tasks/context">
<groupMarker name="new_custom_task"/>
</menu>
Here, I use the same "path" for my submenu that I use for the
"menubarPath" in the Action. Yet the submenu doesn't appear anywhere when
I do it this way. However, if I remove the "path" field from the tag, then
this submenu shows up as a top-level menu in the menu bar, which is not
what I want either (although it's better than not showing up at all).
I assume that there's something wrong with the way I'm using my "path" and
"menubarPath" fields, but I've tried every permutation I can think of, and
still no luck. I'm convinced that there must be something extremely
simple I'm overlooking. Can anyone give me a clue?
thanks.
|
|
|
Re: Adding submenus to custom menus [message #455321 is a reply to message #455319] |
Wed, 20 September 2006 17:17   |
Eclipse User |
|
|
|
Never mind. The problem was that the Actions that I was adding to the
submenus had the wrong path. I needed to precede their path with the path
to the main menu, instead of just the path to the submenu.
Funny how I wrestled with this for days, and it's not until I post a
question to the newsgroup that I end up figuring it out on my own. :-)
Thanks,
Geoff
On Wed, 20 Sep 2006 14:34:26 -0600, Geoff Draper wrote:
> I added a new menu to the menu bar using the following <menu> tag inside a
> <actionSet> tag:
> <menu id="tasks"
> label="Tasks">
> <groupMarker name="top"/>
> <separator name="separator"/>
> <groupMarker name="context"/>
> </menu>
>
> The problem is that I can add Actions to this menu, but not submenus. For
> example, the following correctly adds an Action to the above menu:
> <action
> class="(classname)"
> id="(idname)"
> label="This menu entry shows up!"
> menubarPath="tasks/context"
> style="push"/>
>
> But this code does NOT add a submenu to the same menu:
> <menu
> id="addsubtask"
> label="Add Subtask"
> path="tasks/context">
> <groupMarker name="new_custom_task"/>
> </menu>
>
> Here, I use the same "path" for my submenu that I use for the
> "menubarPath" in the Action. Yet the submenu doesn't appear anywhere when
> I do it this way. However, if I remove the "path" field from the tag, then
> this submenu shows up as a top-level menu in the menu bar, which is not
> what I want either (although it's better than not showing up at all).
>
> I assume that there's something wrong with the way I'm using my "path" and
> "menubarPath" fields, but I've tried every permutation I can think of, and
> still no luck. I'm convinced that there must be something extremely
> simple I'm overlooking. Can anyone give me a clue?
>
> thanks.
|
|
|
|
Powered by
FUDForum. Page generated in 0.03030 seconds