Skip to content
This repository has been archived by the owner on Aug 9, 2021. It is now read-only.

Question: What's wrong with my env? #17

Open
lightness opened this issue Mar 22, 2020 · 2 comments
Open

Question: What's wrong with my env? #17

lightness opened this issue Mar 22, 2020 · 2 comments

Comments

@lightness
Copy link

Hi. First of all thanks for such interesting idea! 🚀

I just stuck with small issue when trying out starter project (https://docs.nodegui.org/docs/guides/tutorial/#trying-out-the-starter-project)

When I running npm start webpack works well, but then I don't see any window. I see qode application in the Dock, but not window.

Probably I miss something. Could you help me with that, please?
Thanks!

Env:
OS: MacOS Catalina v10.15.3

$ node -v
v10.17.0
$ npm -v
6.13.0
$ npm list @nodegui/qode
[email protected] /Users/nb-078-11b/projects/nodegui-starter
└─┬ @nodegui/[email protected]
  └── @nodegui/[email protected] 
@a7ul
Copy link
Collaborator

a7ul commented Mar 22, 2020

Could you post the contents of index.ts file ? @lightness

@lightness
Copy link
Author

lightness commented Mar 23, 2020

Sure @master-atul

import { QMainWindow, QWidget, QLabel, FlexLayout, QPushButton, QIcon } from '@nodegui/nodegui';
import logo from '../assets/logox200.png';

const win = new QMainWindow();
win.setWindowTitle("Hello World");

const centralWidget = new QWidget();
centralWidget.setObjectName("myroot");
const rootLayout = new FlexLayout();
centralWidget.setLayout(rootLayout);

const label = new QLabel();
label.setObjectName("mylabel");
label.setText("Hello");

const button = new QPushButton();
button.setIcon(new QIcon(logo));

const label2 = new QLabel();
label2.setText("World");
label2.setInlineStyle(`
  color: red;
`);

rootLayout.addWidget(label);
rootLayout.addWidget(button);
rootLayout.addWidget(label2);
win.setCentralWidget(centralWidget);
win.setStyleSheet(
  `
    #myroot {
      background-color: #009688;
      height: '100%';
      align-items: 'center';
      justify-content: 'center';
    }
    #mylabel {
      font-size: 16px;
      font-weight: bold;
      padding: 1;
    }
  `
);
win.show();

(global as any).win = win;

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants