Fri 03 Mar 2017 01:46:39 AM UTC, comment #10:
To be an ordinary menu, I think it needs to be added at the same time the figure is created. There is already a function that does that for FLTK in scripts/plot/util/private/__add_default_menu__.m. It's not hard to extend it to Qt, but the choice of what goes in the menus is different.
|
Mon 27 Feb 2017 06:13:30 PM UTC, comment #9:
Okay, that's something we didn't know. The built-in menu is not particularly special, although it still needs to turn off when
is used, but leave any user-created uimenu items.
|
Mon 27 Feb 2017 12:59:59 PM UTC, comment #8:
I removed the patch from bug #49734 that I was testing and now the menu appears at the rightmost position as expected.
Otherwise, yes, in Matlab, the built-in menus are visible from findall and can be modified/removed/etc.
|
Fri 24 Feb 2017 05:14:41 PM UTC, comment #7:
The answer to the first part of your question is "yes", the menu appears at the rightmost position if no "position" property is specified. In Octave,
The position is after the "File", "Edit", and "Help" menubar items.
As to whether findall should return uimenu items that belong to the built-in menu, that is something that should be checked in Matlab. It is not clear from the documentation that these entries are ordinary uimenu items. Sample code to check would be
Run this code and see if hm is empty or not and what labels are returned.
|
Fri 24 Feb 2017 11:11:33 AM UTC, comment #6:
@Rik, thanks for the change. My compiled Octave includes a patch from bug #49734 so I'm not sure I test things appropriately but what do you get with this:
I would expect the new menu to be at the right-most position and findall to return the handles of all menus (ie File/Edit/Help as well).
|
Fri 24 Feb 2017 12:10:58 AM UTC, comment #5:
For Qt, I checked in a change on the development branch that makes uimenu compatible with Matlab (http://hg.savannah.gnu.org/hgweb/octave/rev/73f7ef7169ac).
That still leaves the problem with FLTK.
|
Thu 23 Feb 2017 09:26:10 PM UTC, comment #4:
There are two different issues here (since there is separate driver code for Qt and for FLTK).
For FLTK, the problem seems to be an off-by-1 error. Octave uses '1' to indicate the first position, but FLTK uses '0'. Somewehere, probably in _init_fltk_.cc the position variable needs to be decremented by 1.
For Qt, numbering works correctly but the default menu of "File Edit Help" is always placed to the left of any user-created menus. The default menubar items need to be treated as ordinary menu items that can be mixed with the user's own uimenu items.
|
Thu 23 Feb 2017 07:34:31 AM UTC, comment #3:
Oops, sorry for the mistake... Please swap leftmost and rightmost in my bug report!
Was a bit tired, I suppose...
|
Thu 23 Feb 2017 01:16:53 AM UTC, comment #2:
Also, I can confirm that FLTK will sometimes put the menu in between "File" and "Edit" and sometimes to the left of "File".
|
Thu 23 Feb 2017 01:13:00 AM UTC, comment #1:
Could you attach a picture taken from Matlab so we can see what the behavior is supposed to be? According to your last comment, "position 1 should always be the rightmost position, before all other menu items." This doesn't make sense to me, unless you meant "leftmost".
|
Tue 21 Feb 2017 01:55:20 PM UTC, original submission:
In qt graphics, the following commands place the uimenu at the leftmost position (after the File / Edit / Help menu items):
graphics_toolkit ('qt');
x=[0:0.1:2*pi]; y=sin(x);plot(x,y);
uimenu('label','menu1','position',1);
But in fltk graphics, the same commands place the uimenu between the File and Edit menu items.
graphics_toolkit ('fltk');
x=[0:0.1:2*pi]; y=sin(x);plot(x,y);
uimenu('label','menu1','position',1);
And sometimes, it also places the uimenu at the first position, like in the following case:
graphics_toolkit ('fltk');
uimenu('label','menu1','position',1);
To be consistent with MATLAB, position 1 should always be the rightmost position, before all other menu items.
|