Monthly Archives: January 2014

If the title reads a little weird, you have successfully spotted my failure in using coding jargon effectively.

Processing.js allows you to create beautiful applications with Java or Javascript, or a mix of both if you are particularly hard to please. Here’s a tutorial on how to put your existing Processing.js applications inside a GTK window.

1)Make your Processing application. The documentation on the websites is easy to pickup.

2)Export the application to javascript after downloading/installing the javascript mode from the processing.js website. When you do this, four objects are generated inside the web-export folder inside the folder that contains your Processing files(.pde files). These are
->An index.html file
->A mysterious folder called libs that has nothing in it. (?)
->Your application file, a "your-application-name".pde file
->The processing.js script itself

3)Copy the above files/folders into the folder in which you want to create your GTK application, let the path of this folder be ~/suddenly-wishful

4)Create a file of your choice in ~/suddenly-wishful/, say “your-application-name”.js

The above code snippet is a complete rip-off of the javascript tutorial for helloWorld.js on developer.gnome.org[1] except for the addition of

settings.set_property('enable-file-access-from-file-uris', 1)

in the code which enables you to use an existing html file for the diasplay inside your GTK window instead of loading a URL. In other words, you can use a File URI for the display inside your GTK window.