Trait for containers? #539
Replies: 2 comments 3 replies
-
I have thought about it some more and I think the |
Beta Was this translation helpful? Give feedback.
-
I'd say it might be worth finding a common denominator. The same goes for As a complete newcomer, I got an impression that containers lack unification, which can cause a further fragmentation of APIs. |
Beta Was this translation helpful? Give feedback.
-
Could there be a trait for containers? There is an implicit pattern of containers implementing something similar to
for example CentralPanel, SidePanel, TopBottomPanel
but there is also
Area
Resize, ScrollArea
Window
CollapsingHeader
and both
for ComboBox
I'm sure this has already been thought about and i think it would make it easier to implement custom Ui containers, because it would be easier to know what you have to implement.
There seems to be a distinction between containers that add their own Ui and those that just wrap another and pass their responses right through. This seems to determine whether the method takes a
&CtxRef
or a&mut Ui
and also what kind of response it returns. In general the response seems to be pretty generic, so maybe a Response trait would make sense too?Maybe there are more abstractions needed here to make this clean, but I think these parts of the code are still very much implicit and not fully modelled out. That makes it kind of difficult to understand how the pieces belong together.
Beta Was this translation helpful? Give feedback.
All reactions