简体   繁体   中英

Opening menu in a MultiColumnList in Spec gives MNU

In Pharo 3 right-clicking in a menu using a MultiColumnListModel gives a MessageNotUnderstood, as shown in this example code:

| specModel list itemMenu group1 item1 |

itemMenu := MenuModel new.
item1 := MenuItemModel new
    name: 'Browse';
    shortcut: $b command;       
    enabled: true;
    action: [ self halt ];
    yourself.
group1 := MenuGroupModel new
    addMenuItem: item1;
    autoRefresh: true;
    yourself.
itemMenu addMenuGroup: group1.

specModel := DynamicComposableModel new
    instantiateModels: #(list MultiColumnListModel);
    yourself.
list := specModel list
    items: {$a. $b. $c. $d. $f.};
    displayBlock: [:e | {e asString. e isVowel asString} ];
    menu: itemMenu;
    yourself.
specModel
    openWithSpecLayout: (SpecLayout composed
        newRow: [: r | r add: #list ];
        yourself).

Is this a bug in Spec or I am missing something?

That is a well-known current bug in Spec. There are several places where right-clicks MNU

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM