8000 how to use ipc · Issue #111 · electron-webapps/meteor-electron · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
how to use ipc #111
Open
Open
@juceling

Description

@juceling

hi.
thx for your package.
I`m newbie in programming.

I`m asking how to use ipc with my meteor app.
I want to send ipc mesasge to electron main process.
I found "onWindowEvent" & "onEvent" method at preload.js. so, I used "onWindowEvent". But nothing was happen.
so, I inserted some code to test with ipc communication... like below...

// client/index.js
Electron = {
  // ...
  send: function() {},
  // ...
}

// preload.js
var ipc = require('electron').ipcRenderer;
ElectronImplementation = {
  // ...
  send: function(event, opts) {
      ipc.send(event, opts);
  },
  // ...
}

// proxyWindowEvents.js
var ipcMain = require('ipc-main');
var proxyWindowEvents = function(window) {
  ipc.on('do-test', function(event, arg) {
    // just for checking... 
    dialog.showOpenDialog(window, {
      title: "ipc test done."
    });
  });
}

// my meteor code with coffee-script
Electron.send "do-test", "whatsup"

but, nothing was happen. dialog is not opened.

this is not correct implementation?
or I`m missing something usage with already implemented codes?

I`m newbie in programming. please anybody tell me anything about this...

thank you for reading my ugly english

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0