Code Monkey home page Code Monkey logo

Comments (5)

cronvel avatar cronvel commented on July 20, 2024

By multi-line menu, do you mean a drop-down menu?

There is one, but it is still in alpha version. It's part of the "Document Model" currently under development.

You can see it working by running the script located in sample/document/drop-down-menu-test.js.

There is no documentation on that for instance, because the API may change during the development process.

from terminal-kit.

kmgilbert100 avatar kmgilbert100 commented on July 20, 2024

I just want to replace the npm module terminal-menu as it has node 0.12*> issues, Ive had to switch to inquirer JS ... Built a unlimited level menu system for a terminal application with inquirer ... haha .. would be cool to have a feature like that in terminal-kit... Can't belive there is no multi-level menu module out there for node... I may make one myself.

from terminal-kit.

cronvel avatar cronvel commented on July 20, 2024

Okey, I have checked 'terminal-menu'.

This feature exists in terminal-kit, in alpha version, part of the "Document Model", and the sample code is here:
sample/document/column-menu-test.js

tl;dr:

var termkit = require( 'terminal-kit' ) ;
var term = termkit.terminal ;

var document = term.createDocument() ;
var columnMenu = termkit.ColumnMenu.create( {
    parent: document ,
    x: 0 , // x and
    y: 5 , // y position of the top-left corner
    items: [
        {
            content: 'File' , // menu item text
            value: 'file' // menu item value (passed to the 'submit' event)
        } ,
        ... // more menu item
    ]
} ) ;

columnMenu.on( 'submit' , function( value ) {
    // submit code
} ) ;

document.giveFocusTo( columnMenu ) ;  // give the focus to the menu now

from terminal-kit.

kmgilbert100 avatar kmgilbert100 commented on July 20, 2024

Very cool - Thanks I'll take a look at the example when I can!

from terminal-kit.

cronvel avatar cronvel commented on July 20, 2024

@kmgilbert100 This feature now exists out of the document model: .singleColumnMenu()

from terminal-kit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.