0.1.6 • Published 9 years ago

native-msg-box v0.1.6

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

native-msg-box

Allows you to display a native MessageBox / Dialog.

By native we mean an OS level, not a browser level dialog.

Example:

var msgbox = require('native-msg-box');
msgbox.prompt({
  msg: "Hunt the Wumpus?",
  title: "Game"
}, function(err, result) {
  switch (result) {
    case msgbox.Result.YES:
      console.log("pressed yes");
      break;
    case msgbox.Result.NO:
      console.log("pressed no");
      break;
  }
});

API:

  • prompt(options, callback)

    options

    msg {string} REQUIRED The message to display

    title {string} optional. Title for dialog (not available on all OSes ... yet?)

    callback

    The callback gets passed an err and a result. At the moment err should always be null. result is one of

    Result.YES
    Result.NO

    Why not just a simple true or false? Because the future possibility of more values like Cancel, Retry, etc..

Prerequisites

Currently the Linux verison requires wmctrl and zentiy.

To Do

  • Add more dialog types. For example

    • a single string prompt "Enter Name: ____"
    • other buttons like "Ok", "Cancel"
0.1.6

9 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago