SWT Bug Triage

If you are a GTK/SWT developer and want to be involved in SWT Triage,
Then you should read:

It is also useful to subscribe to the swt-platform email in bugzilla.
This way you’ll get emails for new SWT bugs and comment update on un-assigned bugs.
To do this, go to bugzilla, -> Preferences -> Email preferences
-> “Add users to my watch list” , add: platform-swt-inbox@eclipse.org
The only trouble is that you’ll get emails for all platforms (Windows/Mac/Linux) and you’ll have to create some filters for sorting things out. But in general I found that it’s good to be ‘aware’ of the issues that happen on windows/mac, as those sometimes occur on Linux also, or a bug labeled as ‘windows’ often impacts linux swt also.



How to create cross-platform SWT applications packaged in a single jar in Eclipse

The deal with SWT is that you geneally create a jar that runs nativley on a single platform.

This means that if you want to create an application that works on windows/mac/linux in both 32/64 bit, then you need to compile/package jar 6 files and distribute one file per platform.

This is very cumbersome for small projects where you want a single file that runs on every platform.

The solution is to bundle the jars and load them dynamically with Mchr3k’s SWT Jar loader.

The next challenge is how to get this business working in Eclipse. Well, there is a guide for this.

Basically, you create a project with the name “HelloWorld”, you have to
download the swt jar’s and rename them to match os/version and then you
have to add a build.xml file. This takes about 30 minutes.

I followed the guide and actually got it to work.

To make life easier, I created a git-repo with a template project.  You can clone it and start a SWT project with that.

I used swt 4.4 in the project. In the future you might want to update it. To do so:

  • Download the latest jar files from Eclipse’s download site .
    • click on the most recent version, e.g ‘4’4,
    • then search for “SWT Binary and Source”
    • download the Windows 32/64 Versions,   linux x86/x86_64/GTK+ versions, Mac OS X versions
    • open the archives and extract the ‘swt.jar’ files
    • match the jar files to the jar files in the project ./gui folder. But append new version. (4.4 -> 4.x)
  • Edit the build.xml file,
    • change the “swtversion=”4.4″” to the newer version.
    • Also update <fileset dir=”./gui” includes=”swt-*-4.4.jar” />

Screen shots:



You can run the generated jar file with ‘java -jar crossSWT.jar”:

crossSWT jar


Here I had to launch the jar with a special paramater:
java -jar -XstartOnFirstThread crossSWT.jar
os x


I don’t use windows :-), but rumors has it works on windows also.

pipe commands into clipboard

I often need to pipe commands into the clipboard. E.g when I type “pwd” to get the present working directory, I would normally select the line and then copy it into my clipboard.

After a while this became tedious so I wrote a script to make life easier. I created a bash script called “toclip”…

Continue reading

Create an area screenshot, host it on github and copy web url to clipboard with one command

I often find myself having to create a screenshot and upload it somewhere so that I can paste it on irc/(mail without adding weight to email)/bugzilla etc.

Eventually I solved the problem by writing  a script that:

  1. Creates a screenshot of an area (gnome-screenshot)
  2. Saves it to your picture folder
  3. adds/commits/pushes to your git hub
  4. copies path to your clipboard
  5. opens chrome to verify that screenshot uploaded successfully.


Continue reading