I general, we try to avoid "convenience" methods, since, for many cases, WTKX is meant to fill this role. However, since menus are often dynamically constructed and manipulated, it may make sense to define some here.

On Aug 2, 2009, at 4:01 PM, Noel Grandin wrote:

Hi

Surely we can improve the common experience by adding some utility
methods to the API?

We should be able to shrink the code snippet to:
      MenuBar bar = new MenuBar();
      Menu.Section section = bar.getSections().add("default");
      section.addItem("Open...");
      Frame frame = new Frame("Menus", bar);
      frame.open( display );

or just
      MenuBar bar = new MenuBar();
      bar.addItem("Open...");
      Frame frame = new Frame("Menus", bar);
      frame.open( display );
for the common case where there is only one section (i.e. one would be
auto-created).

What is the general feeling about adding these kinds of utility methods?

Too many of them can create clutter, but a small handful can provide a
very valuable helping hand to people beginning to use Pivot.

Regards,
  Noel Grandin.

Reply via email to