const {fs, Button, TextView, TextInput, ui} = require('tabris');
let file = fs.filesDir + '/hello1.txt';
console.log(file);
let btnReadFile = new Button({
centerX: 0,
top: 'prev() 10',
text: 'Read File',
image: {src:'https://github.com/mrmccormack/imd-learning-tabris/blob/master/images/card.png?raw=true', scale: 1}
})
.appendTo(ui.contentView);
btnReadFile.on('select', () => {
console.log ('you pressed btnReadFile');
fs.readFile(file, 'utf-8')
.then(text => myText.text = text)
.then(text => myLabel.text = text)
.catch(err => console.error(err));