Fork me on GitHub
#cljfx
<
2021-12-02
>
markbastian17:12:30

How might I add a context menu to a tree item or a table row? For example, something like this:

{:fx/type  :tree-item
 :value    1
 :children [2 3 4 5]
 :context-menu {:fx/type :context-menu
                :items   [{:fx/type   :menu-item
                           :text      "Some menu item..."
                           :on-action {:event/type ::show-value}}]}}
Note that the above :context-menu is not a valid property - this is just for illustration.

vlaaad10:12:20

I was thinking something like this exists, but it seems I’m wrong

vlaaad10:12:18

I mixed it up with https://github.com/cljfx/cljfx/blob/master/src/cljfx/ext/node.clj — extension to install tooltips on non-Control nodes

vlaaad10:12:41

maybe something similar can be done for installing context menus…