News for hackers. Stuff that matters.
Re:C++ UI Libraries by BubRoss on Friday May 10, 2019 @06:58PM (#19883063)
I'm talking about unnecessary complexity when laying out the gui, not implementation. There is no reason to introduce HTML with the various rules in various places, verbosity and indirection. It's a scenario that seems like when all you have is a hammer, everything looks like a nail.

> And you will see EXACTLY the same structure in any GUI framework/system.

I'm sure it works fine, but I wouldn't get stuck on thinking there is no other way.

Re:C++ UI Libraries by c-smile on Friday May 10, 2019 @08:38PM (#19883634)
"a hammer" you mean Electron and it's full scale browser, right?

"I wouldn't get stuck on thinking there is no other way"

There is a way, named "Dear ImGUI", that does not use DOM structure but rather recreates its on each paint event.

Re:C++ UI Libraries by BubRoss on Friday May 10, 2019 @09:34PM (#19883912)
You need to focus, no one is talking about electron. It's in its own world of nonsense.

> There is a way, named "Dear ImGUI"

I'm not talking about immediate GUIs (and they use a heirarchy for layout too of course). You put some example c++ and said every GUI has that same structure, which isn't necessarily true. A heirarchy doesn't have to be implemented with a tree of pointers.

I'm not saying these things can't work, but saying 'this is how it must be done' is just not true.

Re:C++ UI Libraries by jcelerier on Saturday May 11, 2019 @01:46AM (#19884779)
But it is though. If you need to have accessibility support in your GUI, all the native accessibility APIs are based on trees so you're going to have to create that tree one way or another.
Re:C++ UI Libraries by c-smile on Saturday May 11, 2019 @01:13AM (#19884682)
> every GUI has that same structure, which isn't necessarily true

I'd insist on EVERY here. Container holds list of children. Child holds reference to parent - typical tree implementation.

If you have in mind something else - please show.

Re:C++ UI Libraries by BubRoss on Saturday May 11, 2019 @09:02AM (#19885946)
You showed a few lines of C++. Even for heirarchy,this doesn't need to be a tree of pointers. It's not so bad if it is, but data can be represented as tables or arrays of attributes. Really in a ui the layout is about dependencies and doesn't strictly have to be hierarchy. It's not all that important, just saying that everything must be done in a certain way is ridiculous.
Re:C++ UI Libraries by c-smile on Saturday May 11, 2019 @11:25AM (#19886623)
You can do inside whatever you want but you shall provide an API similar to these two functions: HWND GetParent(HWND child) and EnumChildWindows(HWND parent, callback).

Once again: IAccessibility mandates tree organization of your UI. You can do whatever you want but your UI framework MUST expose UI structure as a tree.

Re:C++ UI Libraries by BubRoss on Saturday May 11, 2019 @12:37PM (#19886998)
This is just moving the goal posts. First you said every GUI needs a markup language, then a specific pointer tree internal structure, now accessibility and specific exposed API.