https://github.com/jerbaroo/threepenny-gui-contextmenu
Nested context menus for Threepenny-gui
https://github.com/jerbaroo/threepenny-gui-contextmenu
contextmenu haskell right-click threepenny-gui
Last synced: 3 months ago
JSON representation
Nested context menus for Threepenny-gui
- Host: GitHub
- URL: https://github.com/jerbaroo/threepenny-gui-contextmenu
- Owner: jerbaroo
- License: bsd-3-clause
- Created: 2016-12-05T16:13:31.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-04T19:42:48.000Z (almost 9 years ago)
- Last Synced: 2025-07-15T19:24:50.014Z (8 months ago)
- Topics: contextmenu, haskell, right-click, threepenny-gui
- Language: Haskell
- Homepage:
- Size: 31.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Threepenny-gui Context Menu
A right-click menu simply consists of menu items. These menu items can either
run UI actions when clicked, or contain a nested menu which is opened on hover.
We provide constructors for both of these types of menu items, those with UI
actions to run and those with a nested menu.
For the constructor of a menu item with UI actions you need to provide a title
and a list of the UI actions to run.
``` haskell
actionMenuItem "red" []
```
For the constructor of a menu item containing a nested menu item you need to
provide a title and a list of menu items.
``` haskell
ourMenuItems = [
nestedMenuItem "more" [
actionMenuItem "red" []
, actionMenuItem "blue" []
]
]
```
Finally to build a context menu we also need to know which element, when
clicked, activates the context menu.
``` haskell
someElement # contextMenu ourMenuItems
```