Skip to content

Instantly share code, notes, and snippets.

@bryphe
Created February 3, 2018 22:59
Show Gist options
  • Save bryphe/de46c1088e8ca09e9d12dfe7d9313f9b to your computer and use it in GitHub Desktop.
Save bryphe/de46c1088e8ca09e9d12dfe7d9313f9b to your computer and use it in GitHub Desktop.
// Inside the 'activate' method in your config...
const createMenu = () => {
const myMonthsMenu = oni.menu.create()
const months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
const menuItems = months.map((s) => ({ icon: "calendar", label: s}))
myMonthsMenu.show()
myMonthsMenu.setItems(menuItems)
}
oni.input.bind("<c-space>", createMenu)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment