[GUI] Another RFC on setting and getting.

Vincenzo Ciancia ciancia@cli.di.unipi.it
Tue, 8 Apr 2003 22:07:29 +0200


On Tue, 8 Apr 2003 10:49:46 +0100
Axel Simon <A.Simon@ukc.ac.uk> wrote:

> Ok, some inspiration: Gtk allows labels to contain
>  either a simple string or markup like
>  "<red>warning</red>: about to erase file". If the
>  markup is passed as an algebraic data type we would
>  need to parse the label's text in order to get the
>  algebraic data type back. So it's easier to consider
>  the text of a Gtk lable as write only. But the label
>  can be changed after the creation.

You can also record the label's value, in algebraic form, in a mutable
variable wich stays in the haskell land. Of course, if the toolkit
itself can change the label, this makes few sense, and OTOH, it might be
not so bad if you parse back the text: if the widget is not a label but
a textbox, it's perfectly legitimate that the user cuts and pastes
formatted text, and you have to read that back.

Perhaps in this particular case it's easier to say: that is not markup,
it's a string. A successive layer will take care of markup and similar
issues.

Vincenzo