Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Is it possible to associate a uicontextmenu to a toggletool?

Subject: Is it possible to associate a uicontextmenu to a toggletool?

From: Camille Couzi

Date: 23 Nov, 2010 12:50:04

Message: 1 of 1

Hi people!
I am trying to make my own toolbar, and I want to associate a uicontext menu to a toggle tool. In the help page of the uitoggletoolPoperties, it says:

UIContextMenu
    handle
    Associate a context menu with uicontrol. This property has no effect on uitoggletool objects.

So I wonder if "This property has no effect on uitoggletool objects." means that it is not possible to attach a context menu to a toggletool.
In fact, when I try to do it, I get an error. this is what I write in my script:


uicmenu_cargar=uicontextmenu;
set(h.tool_cargar,'UIContextMenu', uicmenu_cargar);
set(uicmenu_cargar,'HandleVisibility','on');
cargar1=uimenu(uicmenu_cargar, 'Label', 'one');
cargar2=uimenu(uicmenu_cargar, 'Label', 'two');

Nothing hapens when I click on my toggle tool, the menu with 'one' and 'two' don't appear...

Anybody has an idea?
Thanks for you help.
Camille.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us