j-chad / Eligo

A small python module to build menus using JSON style schema

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

menu_builder

A small python module to build menus using JSON style schema

Example Menu:

import eligo

menu = {
  'type': 'menu',
  'title': 'Example Menu',
  'items': (
    {
      'type': 'menu',
      'title': 'Example Sub-Menu',
      'items': (
                 {
                  'type': 'button',
                  'title': 'Say Hi',
                  'callback': lambda:exec('print(\'Hello, World\');time.sleep(3)')
                 },
                 {
                  'type': 'button',
                  'title': 'Go Back',
                  'breaking': True
                 }
              )
            },
            {
              'type': 'button',
              'title': 'Exit',
              'breaking': True
            }
      )
}

eligo.construct(menu).display()

About

A small python module to build menus using JSON style schema

License:MIT License


Languages

Language:Python 100.0%