3 ms·
Retained-mode GUIs like Qt , wxWidgets, gtk, etc aren't intuitive. Try an immediate mode GUI, like my python bindings to nuklear https://github.com/billsix/py
by billsix 8y ago
Retained-mode GUIs like Qt , wxWidgets, gtk, etc aren't intuitive. Try an immediate mode GUI, like my python bindings to nuklear
https://github.com/billsix/pyNuklear https://github.com/billsix/pyNuklear
- btown 8y agoFor more context, immediate mode is much closer to the type of declarative UI popularized by libraries like React. The invariant is that what is displayed on screen is always a pure function of some state variable(s), and on any input/event, instead of needing to "reach into" some retained object that represents a certain piece of text in a certain pane in a certain window, you just change those state variables and re-render the entire UI from scratch. Sounds expensive, but for a 2D UI on hardware that's designed to do far more complicated things at 60FPS, it's far from the bottleneck. For instance, https://github.com/billsix/pyNuklear/blob/master/demo/overview.py#L305 https://github.com/billsix/pyNuklear/blob/master/demo/overvi... (this function is called repeatedly on each frame) is not significantly different from the example at https://reactjs.org/tutorial/tutorial.html#what-is-react https://reactjs.org/tutorial/tutorial.html#what-is-react ... but it is very different from something like `div = createDiv(); div2 = createDiv(parent=div)` etc. which would be a retained-mode API.
- billsix 8y agohttps://youtu.be/Z1qyvQsjK5Y https://youtu.be/Z1qyvQsjK5Y
- civilian 8y agoAnother option is pyImgui. Imgui is C++ based. pyimgui isn't on the latest imgui version, but it's coming along. https://github.com/swistakm/pyimgui https://github.com/swistakm/pyimgui
- vram22 8y agoWhat is the difference between the two GUI modes?