Addons/demos/gtk

From J Wiki
Jump to navigation Jump to search

Gtk Demos

The Gtk image, life and felidae demos are examples of Gtk and also of typical J projects. Only the source is provided, and the projects first have to be built.

All demos should work correctly on Windows and Linux.

The life demo works on the Mac, but not yet the image demo (not sure why). Also, the image viewer on Windows does not support svg files.

Before trying these, please ensure that you are using the latest base library.

Demos Folder

If you have write access to the ~addons directories, the easiest way to build the projects is to select menu Project|Open and navigate to Demos/gtk/image/base. Select menu Project|Run (or equivalent shortcut) to build and run the project.

Similarly, use Project|Open to navigate to Demos/gtk/life/main, and select menu Project|Run (or equivalent shortcut) to build and run the project.

Study the project build and run scripts to see how these projects are set up.

Projects Folder

You can also copy these projects to another directory, such as ~Projects, for example if you do not have write access to ~addons. The folders would then be:

~Projects/image
~Projects/life
~Projects/felidae1
~Projects/felidae2
~Projects/felidae3

After copying the projects, then references to ~Demos/gtk need to be changed to ~Projects.

The script copy2projects.ijs will do this copy. First ensure the target directories do not already exist, then run:

   load '~addons/demos/gtk/copy2projects.ijs'

You can then build and run the projects as above, this time navigating to the Projects directory.