SybWidget-0.5.2: Library which aids constructing generic (SYB3-based) widgets



PriLabels are labels with a priority.

PriLabels are usefull when widgets can have their label set multiple times. This happens with genericcally created widgets. For example in:

data Foo = Foo { someName :: Bar } data Bar = Bar Int

widgets created from Bar instances can have labels set due it's constructor name and the fieldName in Foo (someName). A GUI application programmer may also set the widgets label.

When a widget has set it's label multiple times, the priority can be used to decide which label should be chosen.



data PriLabel Source

Prioritized label. If two PriLabel can be used for some component, then the one with highest priority is used.




bestLabel :: PriLabel -> PriLabel -> PriLabelSource

Choose label with highest priority. If equal then choose the left |(first parameter) label.

humanizeLabel :: PriLabel -> PriLabelSource

Humanized label strings, by turning labels like someLabelName into Some label name.

defaultLabel :: String -> PriLabelSource

Creates a default (lowest priority) PriLabel