Category Archives: XUL Widgets

FastEventLog.jsm: A quick and dirty event log viewing tool

About this time last year, I introduced a tree views module to my Verbosio XML editing project, which I’m still building infrastructure for.  One piece of that infrastructure uses the TreeViews module, and adapts it for simple sequences of objects in a common format.  Event logs were the use-case for this.

(This is currently independent of Mozilla Firefox’s own Log.jsm support, which is pretty nice itself!)

Let’s say you have a simple array of simple objects.  They all have a certain minimal set of properties.  If you want to visualize these objects laid out in a table, then each row can represent an object, and each column a property of the object.  XUL trees can build this table-like view, but they need some help.  First, they need a tree view that supports objects of the same basic type (TreeViews.jsm).  Second, they need to be built with the columns you want.

FastEventLog.jsm does this.  There’s two methods:  addPropertyColumn() and appendTree().  The first takes a property name, a label, the column width, and a couple other optional details.  The second method takes a box to hold the XUL tree element, a specialized “id prefix”,  a tree height, and the array of objects you want to show to the user.

If you have two separate arrays with the same structure, you can call appendTree twice. (Think expected results versus actual results.)

When working on my asynchronous transaction manager idea (more on that in a future post), I realized I couldn’t easily visualize what had happened.  The Firefox devtools debugger is awesome, especially with Thunderbird’s Remote Developer Tools Server extension.   But the debugger’s JavaScript object tree showed arrays of objects in an ordinary key: value hierarchy.  The data I wanted was buried very deep, and impractical to really analyze.  So I built FastEventLog.jsm and a helper XUL file to turn the tree branches I needed into XUL trees.


The above is a screenshot with a bug deliberately introduced into the underlying transactions test to show what FastEventLog and TreeObjectModel (from TreeViews.jsm) can produce.  This little table view made diagnosing bugs in the async transaction manager very easy!

As usual, this FastEventLog.jsm is available under MPL / GPL / LGPL tri-license.

XUL Widgets 0.5.2 Released

New in this release:

  • XULWidgets bug 15889: Partial fix for file uploads in serverpost. Thanks to arno for the patch; bug is still open at the moment for further work.
  • The menudeck widget has been resurrected; controldeck turns out to have a few unanticipated bugs.
  • textbox.xml now lets the standard XUL toolkit define the textbox’s editor property. Also a little tweak to prevent a textbox.xml error.
  • XUL Widgets will no longer be supported on the 1.8.0.x branch of Gecko code. That means Firefox 1.5 and SeaMonkey 1.0. (I realize SM 1.1 isn’t quite out yet, but it is expected soon.)

XUL Widgets 0.4.0 released

So what’s new this time around?

  • There are now separate CVS tags for Gecko 1.8.0.x and Gecko 1.8.x. This means different XPI packages and XULRunner tarballs for each.
  • Flat XPI’s will update to flat XPI’s in the future, as opposed to jarred XPI’s.
  • One minor bug fix to textbox.xml for validation.

Branch tags are listed under src/data/ in the XUL Widgets repository.

The purpose of this branching is to allow trunk-based and Gecko 1.8.x-based XUL Widgets extensions to line up more with their respective bases. For example, if trunk has implemented a XUL Widgets extension, there’s no need to keep that extension on XUL Widgets’s trunk. Also, new features which could not be supported on Gecko 1.8.0.x branch may now be included for trunk-based and possibly Gecko 1.8.x-based XUL Widgets packages.

The best part about this is that XUL Widgets now supports Gecko 1.8.x and trunk builds. I didn’t fully realize it before, but the packages for XUL Widgets were previously restricted to only the Gecko 1.8.0.x series.

If you installed the flat chrome edition of XUL Widgets, please uninstall version 0.3.x before installing version 0.4.x. If you update directly, the update service will return a jarred chrome edition instead.

Your test results and feedback are most welcome!

The base for XUL Widgets

I’ve been thinking the last few months about a change for XUL Widgets, and now that Firefox 2.0 Beta 1 is available, I need some advice from the community.

XUL Widgets, for those of you who haven’t followed it, is a MozDev project to extend the standard toolkit of XBL-based widgets. Other projects are invited to adopt XUL Widgets as an extension and use the extended toolkit in their own applications. I’ve been updating it from time to time with new features (or fixing bugs in the update code), but now I have to decide which version of’s toolkit XUL Widgets should support.

Currently, there are three versions I’m concerned about: 1.8.0.x branch (Firefox 1.5), 1.8.x branch (Firefox 2.0), and trunk (Firefox 3.0). A few of the changes I’ve made for XUL Widgets have landed in the 1.8.x branch, and a few more in the trunk. So my own unreviewed changes may conflict or degrade the expected results in these versions. On top of that, there are new capabilities in trunk (and to a lesser extent, 1.8.x branch) that weren’t available in 1.8.0.x.

To my knowledge, I’m the only one actiovely using the XUL Widgets extension. If I am truly the only one interested in using it, then there’s no reason for me not to switch its base to trunk. My usage of XUL Widgets is for Verbosio, and that cannot run on the 1.8.0.x or 1.8.x branches.

I’d like your feedback, especially if you use XUL Widgets. Which version of the toolkit should I base my extensions on?

UPDATE: Case in point: Trunk code just now received an active spinbuttons widget, which my integercontrol could easily depend on.

XUL Widgets, version 0.3.0 1 2

To quote Jamie Hyneman, “Whoops!”

In posting the 0.2.* series of XUL Widgets XPI’s, I listed incorrect information in the install.rdf and update.rdf files. This mandates posting a new XUL Widgets 0.3.0 XPI & XULRunner series.

No new functionality, but you will find XULRunner 0.2 will not receive any future updates. So please uninstall it before installing version 0.3. XUL Widgets version 0.3 should be available in 24 hours or less.

UPDATE: Another well-formedness error bit me, install.rdf. 0.3.1 released now.

UPDATE 2 : Note to self: chrome.manifest is useful. 0.3.2 released.

XUL Widgets now supports XULRunner

XUL Widgets installation instructions

By this, I mean XUL Widgets now packages its chrome to be easily dropped into an existing XULRunner application. It’s a beginning step (possibly incorrect, but simple) for building a chrome package for a larger app. I’ll be porting the code used to make this chrome package over to jslib and xpistubs shortly.

UPDATE: JSLib and xpistubs now have code checked in to support XULRunner as well! No new packages generated for jslib yet; I leave that up to the mozdev team.

If you have a xpistubs-based project, drop me a line. I may be able to help you apply the patch to your own project.

XUL Widgets: Textboxes, validation and accessibility

<xul:textbox/> visual examples

This is my initial attempt to give XUL controls a standard set of icons and styling to support new features in XUL Widgets. XUL Widgets will soon support several flavors of <xul:textbox/>:

  • disabled
  • delayed (for when the application wants a time-delay)
  • invalid (for when a control’s value is not valid)
  • warning (for when a control is valid, but the application wants to caution the user)
  • internal-error (a bug internal to the application or widget)
  • OK status (everything checks out)

This is a first draft, and subject to change based on feedback. I asked a11y on news.m.o for some, and got all my replies from /dev/null…

You might be wondering: why would I try to create icons to go with textboxes? The answer is simple: color-blindness is a real and not-so-obvious problem.

I’m also wondering how I can display these icons for people who need the accessibility support, and not display them for those who don’t.

I’ll maintain current drafts of these icons with the XUL Widgets installables fairly soon. (I still have some <xbl:implementation/> code to write.)

A few observations:

  • The tooltips really don’t work in Gecko 1.8. They seem to work nicely in Gecko trunk. (This is a problem until at least the Aviary 2.0 / SeaMonkey 1.1 releases. Help wanted.)
  • In the default Firefox (1.5) theme and in SeaMonkey’s (1.0, trunk) Classic theme, I couldn’t visually tell the difference between a normal textbox and a disabled one without the icon present. (XUL Widgets does a little extra to identically style the textbox itself in a disabled state, with other attributes in play.) The colors essentially matched. This is probably a legitimate a11y bug in the themes.

Comments welcome!

XUL Widgets, version 0.2.1

I’ve just released an updated version of XUL Widgets. New features:

  • The SVG+XUL menuitem binding I created earlier this week, a good start
  • Support for toolkit’s update manifests
  • An initial attempt at documentation (yes, the XUL Widgets Manual is starting)
  • A little bit more styling for XUL textboxes (‘delayed’, ‘warning’)

Accessibility is a big concern I have, and I’m going to spend some time tonight making icons for a future version 0.2.*.

XUL Widgets Installation instructions

Note version 0.2.* is NOT backwards-compatible with version 0.1.*. If you’ve installed version 0.1.* of XUL Widgets, please uninstall it before installing XUL Widgets 0.2.*.