   if arg is yes
     Menu.setApplicationMenu Menu.buildFromTemplate menuTemplate()
   else
-    Menu.setApplicationMenu null
+    Menu.setApplicationMenu Menu.buildFromTemplate emptyMenuTemplate()
 
 # Quit when all windows are closed.
 app.on 'window-all-closed', ->

# be closed automatically when the javascript object is GCed.
mainWindow = null

menuTemplate = -> [
  {
    label: 'Relief Valve'
    submenu: [
      {
        label: 'About Relief Valve'
        selector: 'orderFrontStandardAboutPanel:'
        click: -> mainWindow.webContents.send 'menuItem', 'about'
      }
    ]
  }
  {
    label: 'View'
    submenu: [
      {
        label: 'Reload'
        accelerator: 'Ctrl+R'
        click: -> mainWindow.reload()
      }
      {
        label: 'Toggle DevTools'
        accelerator: 'Shift+Ctrl+I'
        click: -> mainWindow.toggleDevTools()
      }
    ]
  }
]

ipc.on 'running', (event, arg) ->
  console.log "Running: #{arg}"

  mainWindow = new BrowserWindow width: 800, height: 600, show: false

  # Don't use a menu bar.
  Menu.setApplicationMenu Menu.buildFromTemplate emptyMenuTemplate()

  url = "file://#{__dirname}/index.html"

