Re: Common GUI API : What would the code look like?

Glynn Clements <[email protected]>
Newsgroups gmane.comp.lang.haskell.gui
Message-ID <[email protected]>
John Meacham wrote:

> the widget name could just be another property, settable by whatever our
> standard get/set routines turn out to be.

On Xt, the widget name:

a) isn't a property,
b) has to be specified at creation time, and
c) cannot subsequently changed.

You could fudge a), by making the property-handling code have a
special-case trap for the name; but that's ugly.

BTW, some properties have to be specified at creation time, and can't
subsequently be changed.

> if 90% of toolkits ignore the
> name anyway, forcing a user to specify them always would probably result
> in people giving them meaningless names anyway if they don't know what
> they are for.

The proportion of toolkits doesn't matter; if you want to write code
which works on all toolkits, you have to have a name.

Also, there are benefits to having named widgets; e.g. it would be
possible to implement some of Xt's features on other toolkits.

> we can probably generate somewhat useful names
> automatically.  like button1..button3 for the first three children
> buttons of a given widget or whatnot... 

That results in a maintenance headache. If you add another widget,
subsequent widgets would get renamed, and you would then have to
change the resource files to match. Similarly, if a widget is
optional, the names of subsequent widgets would vary.

-- 
Glynn Clements <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.