What is a WCompositeWidget
Added by Matthew Kettlewell over 13 years ago
I'm trying to understand what a composite widget is, and under what conditions it's better to create a widget derived from a container, and when it makes sense to use a composite with an impl...
I suspect that I just don't truly understand what a composite widget is in generic terms...
I can see that they both inherit from WWidget, but why all the hoops for a composite to then create a container impl... I suspect it has something to do with extra layout/containment, but still doesn't explain how a composite widget differs from a container widget...
I guess a little explanation might help me understand... I'm going through the Blog example if you have a concrete example with that.
Matt
Replies (1)
RE: What is a WCompositeWidget - Added by Wim Dumon over 13 years ago
Hi Matt,
Functionally, there's not really a difference between inheriting directly from a WContainer compared to putting the WContainer in a WComposite class. WComposite is rather something to organize your code, and to define a clear API for your new widgets - it 'erases' the API of the class that you use to implement your own functionality.
Best regards,
Wim.