[GUI] Setting properties of a widget.

Glynn Clements glynn.clements@virgin.net
Tue, 1 Apr 2003 01:12:57 +0100


Vincenzo Ciancia wrote:

> >  g) default values for unspecified attributes
> 
> Another thing that comes to my mind is that sometimes one could need to
> atomically give a sequence of values to an attribute. This could be done
> with a function to lock an attribute:
> 
> lock :: Attribute a -> IO (Attribute a)
> 
> release :: Attribute a -> IO ()
> 
> where the result of a lock operation is an attribute wich is a
> representation of the original one, and the only one allowed to make
> modifications until release, or perhaps in a simpler way with
> 
> putList :: Attribute a -> [a] -> IO ()
> 
> Someone wants to comment on this?

There are some situations where certain attributes must be set in
groups (i.e. several attributes must be set by a single call to
Xt[Va]SetValues).

I think that the putList interface is cleaner than lock/set/release. 
Actually, the primary attribute-setting interface should take a list
of assignments; there doesn't seem much benefit in providing a
separate interfaces for setting a single attribute and setting
multiple attributes.

-- 
Glynn Clements <glynn.clements@virgin.net>