Figure out the better way to represent those metadata complexities:
1. IUP elements that have attributes that are applied on children;
Example:
- MDI attributes for Canvas for example
Proposals:
- Render these functions in all possible elements, allowing to set them even when they are not children of the expected element.
- Render these functions on parent element with a special signature
.setXYZ(child, value); Maybe not ergonomics to declare in fluent API.
2. Complex union values
Examples:
- Colors can be an RGB triplet or a well-known alias, like "BGCOLOR", "FGCOLOR", etc.
Tree.setValue expects an i32 representing the index, or a well-known alias, like "NEXT", "PREVIOUS", "ROOT", etc
Proposals
- Status-quo: Declare an
union with each possible value, for example
pub const Color = union(enum) {
BgColor,
FgColor,
Rgb: Rgb,
};
pub const Selection = union(enum) {
Next,
Previous,
Root,
Index: i32
};
- Use
anytype in set; Each case may have a get behavior.
- Declare two functions, one for each type, for example
setColorRgb and setColorStr`
3. Handle or HandleName attributes
Example:
setImage and many others attribute should accept an Image or a string with the HandleName
Proposals
- Status-quo: use aways string, for example
setImage(image.getHandleName())
- Use
anytype in set; Each case may have a get behavior.
- Declare two functions, one for each type, for example
setImage and setImageHandleName`
Figure out the better way to represent those metadata complexities:
1. IUP elements that have attributes that are applied on children;
Example:
Proposals:
.setXYZ(child, value); Maybe not ergonomics to declare in fluent API.2. Complex union values
Examples:
Tree.setValueexpects ani32representing the index, or a well-known alias, like "NEXT", "PREVIOUS", "ROOT", etcProposals
unionwith each possible value, for exampleanytypeinset; Each case may have agetbehavior.setColorRgband setColorStr`3. Handle or HandleName attributes
Example:
setImageand many others attribute should accept anImageor a string with the HandleNameProposals
setImage(image.getHandleName())anytypeinset; Each case may have agetbehavior.setImageand setImageHandleName`