octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need someone to test uimenu features on ML


From: Michael Goffioul
Subject: Re: Need someone to test uimenu features on ML
Date: Tue, 11 Oct 2011 23:14:49 +0100

On Tue, Oct 11, 2011 at 7:18 PM, Søren Hauberg <address@hidden> wrote:
> Hi
>
> tir, 11 10 2011 kl. 16:45 +0100, skrev Michael Goffioul:
>> 1) callback propagation through menu hierarchy:
>>
>> h0 = uimenu ('label', 'Level 0', 'callback', @() disp('level 0'));
>> h1 = uimenu (h0, 'label', 'Level 1', 'callback', @() disp('level 1'));
>> h2 = uimenu (h1, 'label', 'Level 2', 'callback', @() disp('level 2'));
>
> I get some errors here
>
> ??? Error using ==> @()disp('level 0')
> Too many input arguments.

Sorry for that. Please replace "@()" with "@(h,e)" in the 3 above statements.

>> 2) case-sensitive accelerators
>>
>> h0 = uimenu ('label', 'My Menu');
>> h1 = uimenu (h0, 'label', 'Normal', 'accelerator', 'z');
>> h2 = uimenu (h0, 'label', 'Shifted', 'accelerator', 'Z');
>>
>> Then check the accel displayed in the menu and try the following
>> key sequences when the figure has the focus:
>
> I might be doing things wrong, but... When I click on 'My Menu' I get to
> choose between 'Normal' and 'Shifted' and both have the accelerator
> "Ctrl+z". When I click CTRL+Z or CTRL+SHIFT+Z then nothing happens.

It's normal nothing happens, no callback is defined. Could you add a
callback to both menu items to see which one is triggered.

Now, it looks like accelerators are case-insensitive in ML. But I tempted
to extend that to support SHIFT modifier. That is, if accelerator == 'z',
translate it into CTRL+Z, it accelerator == 'Z', translate into CTRL+SHIFT+Z.

This wouldn't be strictly compatible with Matlab, but this would add more
flexibility to the accelerator system. Any other opinion?

Michael.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]