Info

This question is closed. Reopen it to edit or answer.

How do I have a dynamically created and located popup menu display all of its options on the first button push?

1 view (last 30 days)
I want a popupmenu to literally pop-up. I have a uitable. I want to allow the user to click a cell in the table and have a popup menu show up at the cell's location. The popupmenu and uitable are programmed, not created in guide. I have code that places the menu correctly, but only the first menu item shows up when you click on a table entry. On the second button push the entire menu shows up. I want the menu of choices to show up on the first button push, not require the user to click twice.
  2 Comments
Eric Lin
Eric Lin on 19 Jun 2015
Adding to Jan's comment, how is the behavior you are seeing/expecting different from that of the last example in the uitable documentation? Pop-up menus which display all choices on the first click are generated.
f = figure('Position',[100 100 400 150]);
% Column names and column format
columnname = {'Rate','Amount','Available','Fixed/Adj'};
columnformat = {'numeric','bank','logical',{'Fixed' 'Adjustable'}};
% Define the data
d = {6.125678 456.3457 true 'Fixed';...
6.75 510.2342 false 'Adjustable';...
7 658.2 false 'Fixed';};
% Create the uitable
t = uitable('Data', d,...
'ColumnName', columnname,...
'ColumnFormat', columnformat,...
'ColumnEditable', [false false true true],...
'RowName',[]);
% Set width and height
t.Position(3) = t.Extent(3);
t.Position(4) = t.Extent(4);

Answers (0)

Tags

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!