The Widget Plan

written by the entire XPToolkit team

edited by Scott Collins

last modified 2/9/99 by Peter Trudelle

Abstract: Our current strategy for implementing the collection of widgets required by client apps, the risks, and the alternatives we've considered.
Document Status:Rough, but ready for general consumption.
The latest version of this document is available at Please direct all comments and contributions to news:netscape.public.mozilla.xpfe.

Contents

Introduction

One of the services provided by the XP Toolkit is a collection of widgets from which UIs will be composed. By widget, we mean graphical components spanning the range from simple push buttons to complex aggregates like combo-boxes or toolbars. The two ends of the spectrum of possible widget implementation are:
a native widget
A native widget has a look and feel unique to its platform. Its implementation is, at least in part, and very probably in its entirety, specific to that platform. Its core functionality may by supplied `pre-packaged' by the OS.
an XP widget
An XP widget has a single implementation, intended to compile and run across many target platforms. Its look and feel is similar, if not identical, across those platforms.
Both approaches have pros and cons, detailed below.

Objectives

To put this plan into context, consider the overall objectives of the team:
  1. Provide a set of cross-platform widgets, libraries and services that leverage the NGLayout technology to allow single-source development of graphical user interfaces.
    1. Widgets
      1. HTML 4.0 Forms widgets such as buttons, checkboxes and edit fields.
      2. General widgets not found in forms, like disclosure triangles and grippy panes.
      3. Composite widgets such as tree views, toolbars and font pickers.
    2. Services
      1. Clipboard management
      2. Cursor management
      3. Menus and Context Menus
      4. Drag and Drop
      5. Tooltips
      6. File picker glue
      7. Keyboard Navigation
  2. Provide a common resource format for describing the static user interface content, and a means for instantiating the UI from these resources.
  3. Provide a method for specifying stylistic variations separately from content.
  4. Support the the XP GUI needs of the Ender, XPApps and Messenger teams, in particular by providing for downloadable chrome and running on Win32, Linux, MacPPC and  AIX.
This discussion, however, focuses on those objectives under 1.1, "Widgets".

Proposal

  1. The XPToolkit team will provide a a set of GFX widgets that sport a 'Netscape platform' look and feel, details to be provided by the UE folks, who fully support this direction. The XPToolkit team is on the hook for this, but will hopefully be able to leverage work done by the NGLayout team providing form widgets, and by net developers.
  2. The XPToolkit team will provide a 'cascading widget' architecture that allows for implementation and substitution of native widgets. Everyone agrees that native widgets are highly desirable, but until they are identified as a crucial requirement, we don't intend to plan on doing them in this release.
  3. As time/resources become available, native widgets may be implemented and plugged in, according to the priorities of the developers doing the work (e.g., Netscape would probably do Windows first). The XPToolkit team is explicitly NOT committing to supply these in any particular timeframe. We will evaluate doing some of this work when/if we have time in our schedule, approval to add resources, or both.
Pros: Cons: Risks:

We have to do this in a big way, producing a Netscape UI that a large number of users consider a better overall experience than the combination of web and platform-specific UI they get elsewhere. This means appealing to the large number of new Internet users expected in the target timeframe.

Alternatives

All Native Widgets

Any discussion of native widgets must be prefixed with the disclaimer that generalizations are hard to make when, by definition, the issues are extremely platform specific. The authors have made an attempt to be even-handed, but some generalizations may be less than completely applicable.

Pros:

Cons: Native widgets are, in the authors' opinions, unsuitable for web content. At best they do not respond to style specifications in the web content. At worst they do respond to style specifications in the desktop theme. XPFE believe they must provide XP implementations for all widgets which can appear in web content; those being the forms widgets. Other widgets could instead reasonably be native.

All XP Widgets

Pros: Cons: A set of XP forms widgets is a nearly inescapable requirement for providing a consistent web content look and feel. XP non-forms widgets, which will only be used in non-web content such as dialogs, will look alien on every platform.

Mixed Model

Given conclusions likely from the above considerations, that is, some widgets favor an XP implementation and some favor native, one is led to consider doing both. The mixed model is one in which some widgets are native and some are cross-platform.

Pros:

Cons: The mixed model is, at first glance, a ridiculous chimera undeserving of more than glancing notice. At the same time, both the full native and full cross-platform proposals are also unsatisfying. XPFE believe the right solution is a variety of the mixed model.

Appendix: Frequently Asked Questions

Answers to the bulk of the questions can be found above, but are summarized here because people keep asking them.

Won't using XP widgets mean forcing the user to learn a whole new interface?

No. An XP interface doesn't mean an alien interface. Consider it, rather, platform neutral. Can a Mac user decipher a typical dialog on a Windows machine? Certainly. Can a Windows user decipher a typical dialog on a Mac? Of course. A checkbox is a checkbox. A radio button is a radio button. Users familiar with these concepts will recognize them in a conservative XP implementation. Examine some of the UI presented by Netcenter: cross platform dialogues with users, e.g., to login, or to sign up. The success of Netcenter, CD-ROMs, games, AOL, and others, offers positive proof that an XP UI need not be a barrier to user understanding.

Aren't interfaces built from XP widgets ugly? Look at HTML dialogs!

Not necessarily. Again, examine some of the interfaces presented by Netcenter.

Should we use GTK?

Whether to use GTK to implement our XP widgets is orthogonal to this discussion. GTK could give us a flexible XP implementation for widgets, that harmonizes well with the Open Source community. It needs to be ported to the Macintosh, and it needs to be enhanced for Unicode support, but it already has a devoted following. We are currently trying to evaluate the effort required to use GTK compared to that of writing our XP widgets from scratch. However, the possibility of using GTK does not effect the priorities of our implementation.

Native controls are easy. Why do you keep saying they're hard?

Native widgets are easy. Sometimes. As long as you don't try to do anything unusual with them, and have a lot of engineering resources to throw at them.

Everyone agrees that we already require XP widgets for web page content. Content developers really want this in order to provide a consistent look and feel for their web page across all browsers. Most importantly, however, the native widgets on all 3 tier-one platforms are not up to snuff when it comes to HTML 4.0 compliance. They cannot be arbitrarily colored, composited, or easily placed on backgrounds. As a result, we already have a requirement to produce XP form widgets even though there are perfectly good native widgets at our disposal.

In dialogs, however, people want native look and feel. That means they want to use native widgetry. So in addition to writing all the XP form widgets, we also have to write native form widgets so everything appears consistent. Along with the form widgets, we also need to write the set of widgets that reside in dialogs but not forms (tabs, sliders, color pickers, etc).

Summarizing, we have one set of XP form widgets, one set of native form widgets, and one set of dialog widgets. But wait, native form widgets require platform engineers on three platforms. So in reality, we have one set of XP form widgets, 3 sets of native form widgets, and 3 sets of dialog widgets. In a perfect world, this might not be a problem. Even without native widgets, our schedule goes way past the target delivery date, adding them would require adding significant resources.

Won't dialogs that mix XP and native widgets look goofy?

Potentially, especially if native themes are not fully supported. There are also issues with how XP widgets would programmatically fit into an otherwise native dialog. That's why doing native widgets at all  may require doing a complete set, including native versions of the Forms widgets we already need to provide as XP widgets. If we do commit to implementing full native and cross-platform versions of all widgets, we could then specify dialogs which are composed exclusively of one or the other, so the two need not coexist.

Won't applications that mix XP and native dialogs look goofy?

Not any goofier  than Communicator, where we used several quite slow, clunky and ugly HTML dialogs due to resource constraints. We didn't like it, but it didn't seem to drive away many users. Actually, given the superior capabilities and performance of NGLayout, it should be possible to implement simple or obscure dialogs in an XP manner without detracting from native implementations of prominent or sophisticated windows and dialogs.

Won't XP widgets based services embedded in native apps look goofy?

Even if we use native widgets, we may still encounter this problem. The reason being that application developers don't always use standard widgets in their own dialogs. Some draw the standard widgets themselves to fix bugs, some create their own widgets from scratch that don't match the native appearance. If our widgets were fully native, they would look out of place alongside these application-rendered widgets, and we would be no better off than if we used XP widgets.

How can XP widgets keep up with native look and feel as OSs move forward?

They can't. We don't want them to. Down that road lies madness.

The plan, as we move forward, is to augment our XP widgets with native ones. Only native implementations can keep up with the native look and feel for an OS. While we do not have resources internally to attain that goal, we must design the architecture so that others can. If Net developers (or even OS vendors like Apple) get so motivated, they can write their own widgets (since they're so easy, see the previous question) and submit them through mozilla.org.

The architecture will be designed so that in, say, August we can ship a SmartUpdate module with replacement widgets which have native implementations and suddenly Communicator looks much more native.

GTK has `skins'. Doesn't that solve your native look and feel problem?

GTK provides Themes (also called skins) where a designer can customize the look of a widget by providing "a scheme of pixmaps, gradients or solid colors that are applied to all elements of GTK such as buttons with backgrounds, backgrounds in windows etc." There are web pages full of pretty cool looking schemes, which serve simply to indicate that our XP widgets can be made to look cool while retaining user recognizability.

As this question poses, can't we just ship themes that look like each native platform? This is probably the worst thing we could do. We would, in fact, be tricking the poor unsuspecting user because the widget they see may look like a widget they are used to from other applications, but because it is an XP widget, chances are very good that it would not behave like the native widget.

Skins give us look, but not feel, and are in fact damaging to the user experience if used in this manner. As a result, it is imperative that XP widgets have their own look and feel, so as not to elicit comparison to existing widgets.


Valid HTML 4.0!CSS Copyright© 1998 by Netscape Communications; use is undoubtably subject to the NPL.