您好,欢迎光临本网站![请登录][注册会员]  
文件名称: 开发桌面应用框架AtomShell.zip
  所属分类: 其它
  开发工具:
  文件大小: 4mb
  下载次数: 0
  上传时间: 2019-07-18
  提 供 者: weixin_********
 详细说明: Atom Shell 现已改名为 Electron atom-shell 是 GitHub 随 Atom 一起开源的跨操作系统(Windows,Linux,MacOS X)的利用 Web 技术(Node.js、JavaScript、HTML 5)开发桌面应用的框架。Atom即构建在 atom-shell 之上。 与 Node-Webkit 的区别 atom-shell 和Node-Webkit很像,那么两者有什么区别呢? 1. 程序入口 Node-Webkit 的程序入口是一个网页,你在package.json中指定主页,然后这个主页会在浏览器中打开,作为应用程序的主窗口。 atom-shell 的程序入口则是一个 Java Script 脚本,而不是直接指定一个 URL。你需要手动创建浏览器窗口,并通过相应的 API 加载 html 文件。你同时需要监听窗口事件以便决定何时退出应用。 因此,atom-shell 更接近 Node.js 运行时,API 也更加底层,你可以利用 atom-shell 进行 web 测试,类似phantomjs。 2. 编译系统 atom-shell 使用libchromiumcontent访问 Chromium 的 Content API,这样编译 atom-shell 的时候就不用编译整个 Chromium (编译 Chromium 非常费时)。 顺便提一下,GitHub 开发者还创建了brightray库,让 libchromiumcontent 的使用更方便。 3. Node 集成 Node-Webkit 的 Node 集成需要给 Chromium 打补丁才能工作。atom-shell 通过集成 libuv loop 和 平台的 message loop 避免给 Chromium 打补丁。 4. Multi-context Node-Webkit 创造了 Node context 和 web context 的概念,而 atom-shell 没有引入新的 context,而是直接使用 Node 的 Multi-context 特性(这一特性是 Atom 开发者赞助 Node 添加的)。 作者 GitHub 最初考察了 Node-Webkit,但是最终还是决定雇佣zcbenz来开发想要的框架。于是 atom-shell 诞生了。 一个最简单的 hello atom 示例项目请看 hello-atom 主程序示例: var app = require(app);  // Module to control application life. var BrowserWindow = require(browser-window);  // Module to create native browser window. // Report crashes to our server. require(crash-reporter).start(); // Keep a global reference of the window object, if you dont, the window will // be closed automatically when the javascript object is GCed. var mainWindow = null; // Quit when all windows are closed. app.on(window-all-closed, function() {   if (process.platform != darwin)     app.quit(); }); // This method will be called when atom-shell has done everything // initialization and ready for creating browser windows. app.on(ready, function() {   // Create the browser window.   mainWindow = new BrowserWindow({width: 800, height: 600});   // and load the index.html of the app.   mainWindow.loadUrl(file://   __dirname   /index.html);   // Emitted when the window is closed.   mainWindow.on(closed, function() {     // Dereference the window object, usually you would store windows     // in an array if your app supports multi windows, this is the time     // when you should delete the corresponding element.     mainWindow = null;   }); }); 支持很多桌面应用特性,例如 Dock 菜单等: 使用 Dock 菜单的方法: var app = require(app); var Menu = require(menu); var dockMenu = Menu.buildFromTemplate([   { label: New Window, click: function() { console.log(New Window); } },   { label: New Window with Settings, submenu: [     { label: Basic },     { label: Pro},   ]},   { label: New Command...}, ]); app.dock.setMenu(dockMenu); PS:网易也有开放了Hex,同样是不满意node-webkit,就自己做了套. 标签:AtomShell  GUI开发框架
(系统自动生成,下载前可以参看下载内容)

下载文件列表

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.
 相关搜索:
 输入关键字,在本站1000多万海量源码库中尽情搜索: