MatthiasMeger
03/06/2023, 2:50 PMMenu("File", mnemonic = 'F') {
Item("Copy", onClick = { action = "Last action: Copy" }, shortcut = KeyShortcut(Key.C, ctrl = true))
Item("Paste", onClick = { action = "Last action: Paste" }, shortcut = KeyShortcut(Key.V, ctrl = true))
}
This all works in my, including shortcuts and mnemonics.
I know like to add a "listener" to each Item, so when the item gets the focus (but the user hasn't clicked on the item) a "preview" action is triggered.
The reason is: the user can select different background images per item. By navigating through the menu the app should immediately show each background image as soon as an Item gets the focus (in Swing I would listen for "isArmed").
However, first when a item is clicked the background image is really set as new background image.
The desktop tutorials shows how to add PoinerEvents (->https://github.com/JetBrains/compose-jb/tree/2af56d8cbf85d0530b2849545aba65b8668f0f3c/tutorials/Mouse_Events#mouse-enter-listeners).
However, I don't see a modifier parameter I can pass to "Item". How can I add a PointerEvent/Listener to an Item?Dima Avdeev
03/06/2023, 9:10 PMMatthiasMeger
03/06/2023, 10:11 PM