Re: Setting properties of a widget.

Glynn Clements <[email protected]>
Newsgroups gmane.comp.lang.haskell.gui
Message-ID <[email protected]>
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 <[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.