Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collab #1

Closed
kenchangh opened this issue May 25, 2016 · 5 comments
Closed

Collab #1

kenchangh opened this issue May 25, 2016 · 5 comments

Comments

@kenchangh
Copy link

kenchangh commented May 25, 2016

Hey Andrea, let's stick with your repo here since you got npm and Travis set up already.

Will integrate some of my code into the code base by next week. :) Think it would be better if the window function is structured like this:

const window = new libui.Window({
  title: 'Cool',
  width: 700,
  height: 700,
  hasMenu: true,
  margined: false,
  onClosing: (err) => {
    console.log('exited')
  },
});

And also integrate some of my menu code:

const menu = new libui.Menu('File', [
  {
    label: 'Open',
    type: 'item',
    onClick: () => {
      const filepath = window.openFile();
      if (!filepath) {
        window.msgBox('No file selected', "Don't be alarmed");
        return;
      }
      window.msgBox('File selected', filepath);
    }
  },
  {
    label: 'Save',
    type: 'item',
    onClick: () => {
      const filepath = window.saveFile();
      if (!filepath) {
        window.msgBox('No file selected', "Don't be alarmed");
        return;
      }
      window.msgBox('File selected', filepath);
    },
  },
  {
    type: 'about',
    onClick: () => {
      console.log('about');
    },
  },
  {
    type: 'check',
    label: 'Check this',
    onClick: () => {
      console.log('check');
    },
  },
  {
    type: 'preferences',
    onClick: () => {
      console.log('preferences');
    },
  },
]);

My long term plan is to use libui-node and make React components out of it. So others can create desktop apps with React.

@parro-it
Copy link
Owner

parro-it commented May 25, 2016

Hey Andrea, let's stick with your repo here since you got npm and Travis set up already.

👍 I'll add you as collaborator here and on NPM

Will integrate some of my code into the code base by next week. :)

Awesome!

My long term plan is to use libui-node and make React components out of it. So others can create desktop apps with React.

Agreed. I'm planning to do same.

Think it would be better if the window function is structured like this:

What I was thinking is to provide here a barebone API similar to that of libui (using plain functions) and then provide two other modules, one with an imperative API (like the one you started) and another one React Native like.

Anyway, I don't have strong feeling about, I just started and, to be honest, even though I have some year of js - node experience, this is my first native addon, so I'm not sure this make sense (one of the advantages of this plan for me is to reduce amount on C++ code where I'm not so experienced...)

@kenchangh
Copy link
Author

Yeap let's go with barebones. And I'm similar to you. Years of js/node knowledge but I don't really have any knowledge making addons. Pretty new to C++.

@parro-it
Copy link
Owner

Oh that's unfortunate... Well, let's learn together!
Do you have an account on NPM? I'll add you as owner of the package

@kenchangh
Copy link
Author

I'm mavenave on npm also :)

@parro-it
Copy link
Owner

Obviously... Added!

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

No branches or pull requests

2 participants