🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.acorn.tech
Article #619

CFD: Icon names in templates

#619
From: Dick Alstein
Date: Mon, 14 Dec 1992 13:43
51 lines
2764 bytes
This posting is a Call For Discussion. Its purpose is solely to
start a discussion about possible solutions to a problem that
many programmers will have come across, and, hopefully, get some
cooperation from Acorn in solving it.

When you are developing an application that uses templates, your
application must know the numbers of icons in order to support
their function. But when you are adding icons to a template (e.g.
to extend the functionality of the application), you may have to
change the icon numbers.

Upon which you have to adapt the program. You may have to check
every line in which an icon is referred to. Of course you can get
around it partly, by setting a constant or variable (e.g. put a
line like '#define OK_button 2' in a C header file). But you
still have to take care that the icon numbers in the template
definition match those in the program. It becomes a real pain if
you tend to develop a program stepwise (add a feature, test it,
add another feature, etc.).

A solution is to give the icons names, and add these to the
template definition, just as the templates themselves have
identifiers. Then you would only have to look up the icon number
that is linked to the name, at the start of the program. And the
icon references would remain correct throughout revisions of the
templates (provided that the icons keep their - unique - name, of
course).

To make this work, the following is needed:

* A standard for icon names, defining their maximum length and
the way they are stored in a template file. This means that the
file format of template file must be extended. The current
format definition does have room for such an extension.

* A template editor that supports it. It must be able to read,
edit and save the icon names. (I'm currently working on one, and
it shouldn't be too difficult to add this feature.)

* Plus, ideally, a patch module providing an SWI to search for
the icon number belonging to a name. So you can write something
like: SYS "Wimp_IconNameToNumber",,"SaveBox","OK_button" TO ,,,nr%)

Reactions, please. Alternatives, additions, likes & dislikes,
opinions, ... Something like this probably already exists in
other windowing system (Mac, X windows, MS-windows), but I'm not
familiar with any of those. Maybe someone in the know can
describe one of'em. Anyone from Acorn care to react?

Dick Alstein
Technical Details
Message-ID: <4814@svin09.info.win.tue.nl>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sun4nl!tuegate.tue.nl!svin09!wsintt02!wsinda

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sun4nl!tuegate.tue.nl!svin09!wsintt02!wsinda
From: wsinda@wsintt02.info.win.tue.nl (Dick Alstein)
Newsgroups: comp.sys.acorn.tech
Subject: CFD: Icon names in templates
Message-ID: <4814@svin09.info.win.tue.nl>
Date: 14 Dec 92 13:43:02 GMT
Sender: news@svin09.info.win.tue.nl
Reply-To: wsinda@info.win.tue.nl
Lines: 51