11import { QWebEngineView } from "./index" ;
2- import {
3- QMainWindow ,
4- QWidget ,
5- FlexLayout ,
6- QPushButton
7- } from "@nodegui/nodegui" ;
2+ // import {
3+ // QMainWindow,
4+ // QWidget,
5+ // FlexLayout,
6+ // QPushButton
7+ // } from "@nodegui/nodegui";
88
9- const win = new QMainWindow ( ) ;
10- const center = new QWidget ( ) ;
9+ // const win = new QMainWindow();
10+ // const center = new QWidget();
1111const webview = new QWebEngineView ( ) ;
1212webview . setInlineStyle ( "align-self:'stretch';" ) ;
1313webview . load ( "http://google.com" ) ;
@@ -18,12 +18,15 @@ webview.addEventListener("selectionChanged", () => {
1818 console . log ( "selection" , webview . property ( "selectedText" ) . toString ( ) ) ;
1919} ) ;
2020
21- const button = new QPushButton ( ) ;
22- button . setText ( "Hello" ) ;
21+ webview . show ( ) ;
22+ ( global as any ) . wv = webview ;
2323
24- center . setLayout ( new FlexLayout ( ) ) ;
25- center . layout ?. addWidget ( webview ) ;
26- center . layout ?. addWidget ( button ) ;
27- win . setCentralWidget ( center ) ;
28- win . show ( ) ;
29- ( global as any ) . win = win ;
24+ // const button = new QPushButton();
25+ // button.setText("Hello");
26+
27+ // center.setLayout(new FlexLayout());
28+ // center.layout?.addWidget(webview);
29+ // center.layout?.addWidget(button);
30+ // win.setCentralWidget(center);
31+ // win.show();
32+ // (global as any).win = win;
0 commit comments