最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

user interface - I want to write a desktop OSX or Windows app in Javascript -- any experiences? - Stack Overflow

programmeradmin4浏览0评论

I'd like to write some small applications for Windows and OSX.

Portable is good. For instance, the simple TclKit solution for TCL would work well if I could stand to look at Tcl for any length of time.

I'm considering using Javascript + extensions -- I really like Javascript -- seems to me there should be some way to connect a Javascript engine to WxWin or even the Tk toolset -- it's been done for Perl, Python, Ruby, etc. Why not JS?

Any comments appreciated.

I'd like to write some small applications for Windows and OSX.

Portable is good. For instance, the simple TclKit solution for TCL would work well if I could stand to look at Tcl for any length of time.

I'm considering using Javascript + extensions -- I really like Javascript -- seems to me there should be some way to connect a Javascript engine to WxWin or even the Tk toolset -- it's been done for Perl, Python, Ruby, etc. Why not JS?

Any comments appreciated.

Share Improve this question asked Oct 21, 2008 at 19:10 GregGreg 1
  • This is a duplicate of the following: stackoverflow.com/questions/109399/… – Chris Pietschmann Commented Oct 22, 2008 at 2:44
Add a comment  | 

7 Answers 7

Reset to default 9

I would rather recommend using Adobe Air execution container, it offers way more capabilities / OS integration features compared to HTA of Microsoft or even XULRunner of Mozilla.

If you want to write a desktop app in Javascript, check out HTA: http://msdn.microsoft.com/en-us/library/ms536496(VS.85).aspx

Here is an example of an app that I wrote a long time ago in HTA: http://www.boltbait.com/htmleditor/

Hope this helps.

If you have experience with HTML+JS web applications, I'd recommend Mozilla XULRunner. It gives you native-looking interface widgets (every piece of Firefox interface is a XUL element), and a workflow similar to building HTML-based interface.

You define the interface using XUL, an XML-based language, so it's almost like writing HTML, minus browser incompatibilities and CSS (you can use CSS, but only if you want). All application logic can be written in JavaScript, but in XULRunner you can do a lot more in JS than in a browser (read/write files, execute system commands, make cross-domain XMLHTTPRequests, and a lot of other stuff).

More: http://xulplanet.com/

A lot of example applications: http://code.google.com/p/xulapps/

Mac OS X users tend to dislike applications that don't follow usability guidelines of the platform (menu must be at top of the screen, standard shortcuts & drag'n'drop must work, "OK" must be at right-hand side of alertboxes, no "Apply" button in prefs and so on).

With one-size-fits-all toolkit this may be very difficult to achieve.

The good news is that there's JavaScript<>Cocoa bridge that can be used to create stand-alone full-featured Mac OS X application in JS – just keep front-end and back-end of your application separate enough to be able to plug different UI for each OS.

Rhino would probably give you access to swing. Though, I don't know how much work would be involved.

On the other hand, building a swing app with JRuby is so easy even a sock puppet can do it, so it shouldn't be too hard.

Definitely if you want to implement it using JavaScript, Adobe Air is the way to go. You will even have support on Linux.

Give Titanium Appceletaror a look: http://www.appcelerator.com/.

发布评论

评论列表(0)

  1. 暂无评论