nodeguy/src/demo.ts
2019-12-12 19:38:42 +05:30

20 lines
431 B
TypeScript

import { QMainWindow, QPushButton, QLabel, QWidget, FlexLayout } from './index';
const win = new QMainWindow();
const center = new QWidget();
const button = new QPushButton();
button.setText('World');
const hello = new QLabel();
hello.setText('Hello');
center.setLayout(new FlexLayout());
center.layout?.addWidget(button);
center.layout?.addWidget(hello);
win.setCentralWidget(center);
win.show();
(global as any).win = win;