Closed ASHIT-AXAR closed 6 years ago
On Wed, Feb 21, 2018 at 12:26:39PM -0800, ASHIT-AXAR wrote:
i was thinking can we just change the way we use layouts?. something like following (for ex) :
You can already almost do that, though the layout needs to be added to the window first because otherwise the draw functions and create child window stuff isn't initialized.
Maybe changing the code to do that lazily would work though...
and also every widget be able to have at most one child. except layouts.
...but what is the big advantage to doing it this way?
...but what is the big advantage to doing it this way?
i don't know really, in WPF(C#) we just using this approach.
every Control/Widget can have one child (and parent) at most. except Containers/Layouts.
i was never bother myself thinking why. maybe better organizing/control over elements.
layouts/containers (mixing with Margin
and Padding
) are powerful and a great potential (and in my opinion a key) to create structured and good looking UIs
On Thu, Feb 22, 2018 at 12:28:41PM +0000, ASHIT-AXAR wrote:
i don't know really, in WPF(C#) we just using this approach.
Hmm, I have never actually used WPF, heard a lot of good things however. And it makes some sense though, like it often seems silly to give a button child buttons...
But I was modeling this a bit more on the web, where you have a tree of elements and most things can hold other things too, then have their layout adjusted. (You'll see the web influence in a lot of things: margin and padding work like they do in css (mostly), the addEventListener follows the javascript bubbling model, etc.)
layouts/containers (mixing with
Margin
andPadding
) are powerful potential (and in my opinion a key) to create structured and good looking UIs
But you can do that with the way it is now, just the order of calls are slightly different.
hello adam. layout containers can be very useful i was thinking can we just change the way we use layouts?. something like following (for ex) :
this gives more control if be easy to implement. and also every widget be able to have at most one child. except layouts.