Skip to content

Commit

Permalink
Use a block to determine the enablement state of a menu item that is …
Browse files Browse the repository at this point in the history
…created based on a command, otherwise the menu item is not enabled/disabled correctly when its parent menu opens
  • Loading branch information
koendehondt committed Sep 15, 2024
1 parent 0c0d08a commit 452b920
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Spec2-Commander2/CmUICommandDisplayStrategy.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ Extension { #name : 'CmUICommandDisplayStrategy' }

{ #category : '*Spec2-Commander2' }
CmUICommandDisplayStrategy >> display: aCmSpecCommand in: aMenuOrGroupPresenter do: aBlock [

aMenuOrGroupPresenter
addItem: [ :item |
aBlock value: item.
item enabled: aCmSpecCommand canBeExecuted.
item enabled: [ aCmSpecCommand canBeExecuted ].
item ]
]

0 comments on commit 452b920

Please sign in to comment.