Thursday, February 04, 2010

vertical labels in XUL (using XBL and SVG)

I haven't posted in a while. Sorry about that. Eventually I'll post a description of what's gone down in the meantime, what with finishing the degree in Dublin and moving back to the U.S. of A., but for right now, I'd like to post about something else: about putting vertical labels into XULRunner applications.

I searched for a while trying to find an easy way to do this, and the closest I came was a very general-purpose SVG shape solution, which I thought was far to unwieldy for my usage (you can check that out here). My solution is much simpler, using just a single binding with an svg:text attribute in it and not much else.

The source files are as follows:
  • vlabel.xml: The XBL binding for the vertical labels

  • vlabel.xul: A simple XUL file which shows the usage of the vertical labels (if you're in Firefox 3.5 or better, you should be able to view it just by clicking on this link) EDIT: Apparently, this might not work if you're running Linux? I don't know why, sorry.

  • vlabel.css: The CSS file which attaches the binding to the XUL element
And that's all! I hope it is useful to some other XUL developer out there.

No comments: