Created
October 28, 2015 10:24
-
-
Save DavisDevelopment/b29f9355349aba2a794e to your computer and use it in GitHub Desktop.
tnative examples in Haxe 3.2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ; | |
// https://github.com/DavisDevelopment/tnative/blob/master/src/tannus/io/Prompt.hx | |
import tannus.io.Prompt; | |
class PrompUse { | |
/* Program's main function */ | |
public static function main():Void { | |
var namePrompt:Prompt = new Prompt("What's your name? "); | |
namePrompt.getLine( handle_input ); | |
/* | |
== Example Run == | |
>haxe -lib tnative -neko test.n -main PromptUse | |
>neko test.n | |
>what's your name? Ryan Davis | |
the user entered: Ryan Davis | |
*/ | |
} | |
/* function invoked when input has been received */ | |
private static function handle_input(line : String):Void { | |
trace('the user entered: ' + line); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment