Live data from Hacker News

Raygui – A simple and easy-to-use immediate-mode GUI library

github.com

21–30 of 117 posts

Re: Raygui – A simple and easy-to-use immediate-mode GUI library

#21

Before you start picking up a library like this, keep in mind that no immediate-mode GUI library I'm aware of (including this one from what I can see in the source code) has support for assistive technologies such as screen readers. To them the whole UI is one big black box, so your program is completely useless to anyone with a wide range of disabilities.

Do operation systems have APIs, so the program can send them what is on the screen? I mean just description like: There is the button with title "Push me" in the rectangle(50, 50, 100, 70), etc. Or are there any "screen reader" libraries?

Yes they do, at least Apple, Google and Microsoft ones.

On GNU/Linux, I think the only thing that exists in the Gtk+ features that were originally sponsored by Sun.

Re: Raygui – A simple and easy-to-use immediate-mode GUI library

#22

Would it be possible to define the GUI with XML, Unity just added this officially and it makes life much better. Then you do something like rootGUI.Query("elementID").RegisterCallback( e => otherFunc(e));

The joy of immediate mode guis is that you don't have to register callbacks or manually modify (for example) the visibility of elements in response to some action. Instead you do: if checkbox(&show_debug, "Show debugging features") { if button("Run some test") { test()

Joy for ones, pain for others, I don't miss coding GUIs like MS-DOS MODE X or Linux's SVGAlib.

Re: Raygui – A simple and easy-to-use immediate-mode GUI library

#23

Would it be possible to define the GUI with XML, Unity just added this officially and it makes life much better. Then you do something like rootGUI.Query("elementID").RegisterCallback( e => otherFunc(e));

The joy of immediate mode guis is that you don't have to register callbacks or manually modify (for example) the visibility of elements in response to some action. Instead you do: if checkbox(&show_debug, "Show debugging features") { if button("Run some test") { test()

But then if you need to change some non interactive parts of the UI, your digging though source code instead of modifying XML.

Defining the UI via code becomes cumbersome, stuff like adding attributes, etc

Re: Raygui – A simple and easy-to-use immediate-mode GUI library

#24

Before you start picking up a library like this, keep in mind that no immediate-mode GUI library I'm aware of (including this one from what I can see in the source code) has support for assistive technologies such as screen readers. To them the whole UI is one big black box, so your program is completely useless to anyone with a wide range of disabilities.

Do operation systems have APIs, so the program can send them what is on the screen? I mean just description like: There is the button with title "Push me" in the rectangle(50, 50, 100, 70), etc. Or are there any "screen reader" libraries?

Even systems like Qt, where things are drawn using non-native widgets support that (I was long proponent of wxWidgets, because I thought assistive tech is only support only if you use native widgets. The idea of API where you explain what you are showing, and how to interact with it never came to my mind, but with ARIA - like any browser that's the way to go).

Not only that, but I thhink assistive tech should allow you do to easier GUI testing too, but haven't digged into that idea yet (probably folks already are)

Re: Raygui – A simple and easy-to-use immediate-mode GUI library

#25

Would it be possible to define the GUI with XML, Unity just added this officially and it makes life much better. Then you do something like rootGUI.Query("elementID").RegisterCallback( e => otherFunc(e));

Wait until you find out about HTML and the document object in Javascript

Re: Raygui – A simple and easy-to-use immediate-mode GUI library

#26

Earlier quoted context omitted.

Do operation systems have APIs, so the program can send them what is on the screen? I mean just description like: There is the button with title "Push me" in the rectangle(50, 50, 100, 70), etc. Or are there any "screen reader" libraries?

Yes. I don’t know about Windows but I know that for OSX you need to implement the NSAccessibility protocol in AppKit. This gives you a way to describe the hierarchy of the UI and to notify the system of important changes.

[deleted]

Re: Raygui – A simple and easy-to-use immediate-mode GUI library

#27

Related, check out raylib, the rendering/game engine made by the same author! I’ve used Raylib and raygui on a few RPi based projects and recommend it. It’s a really simple, intuitive way to get an OpenGL-based UI running. Good alternative to web-based UIs because it has similar simplicity but runs on devices with lower specs. I built this pinball machine with raylib: https://youtu.be/iiBn7FVzlcc

Ray is amazing. He's been at it since around 2014. Super friendly, super responsive dude

Re: Raygui – A simple and easy-to-use immediate-mode GUI library

#28

Earlier quoted context omitted.

The joy of immediate mode guis is that you don't have to register callbacks or manually modify (for example) the visibility of elements in response to some action. Instead you do: if checkbox(&show_debug, "Show debugging features") { if button("Run some test") { test()

But then if you need to change some non interactive parts of the UI, your digging though source code instead of modifying XML. Defining the UI via code becomes cumbersome, stuff like adding attributes, etc

Changing attributes of UI elements defined in code vs some XML format is in my mind the same level of effort.

button.SetBackground()

or

" />

I see no difference there.

EDIT: Ok the main difference I guess would be having to switch files (and thus context) which could be annoying. Plus there's also the non-zero performance impact from having to parse an XML format.

Re: Raygui – A simple and easy-to-use immediate-mode GUI library

#29
post #28

Earlier quoted context omitted.

But then if you need to change some non interactive parts of the UI, your digging though source code instead of modifying XML. Defining the UI via code becomes cumbersome, stuff like adding attributes, etc

Changing attributes of UI elements defined in code vs some XML format is in my mind the same level of effort. button.SetBackground( ) or " /> I see no difference there. EDIT: Ok the main difference I guess would be having to switch files (and thus context) which could be annoying. Plus there's also the non-zero performance impact from having to parse an XML format.

What if you have stacked elements, or elements within elements.

In code it's something weird like

Box(button( Icon() )))

Re: Raygui – A simple and easy-to-use immediate-mode GUI library

#30

I have seen quite often 'immediate mode gui' on HN and elsewhere these days,I rarely do GUI myself, where are these im-gui's use cases? gaming only? or some embedded boards with limited resources can benefit to draw some pixels on a small LCD for a simple GUI(even that people are more likely use some light-weight x11 like libraries instead of im-gui library)? Other than game-development why is im-gui better than thos…

Many people at a certain point in their careers become infatuated with the idea of making a "small", "simple", and "opinionated" component free from legacy "BS". They have the skill to implement the core of that component but lack the wisdom and humility to understand that the "BS" complexity exists for good reasons, that their "small" component is subject to those reasons, and that they haven't actually found a fundamentally better approach that avoids the "BS", but merely skipped the hard parts of software engineering.

You just have to let people go through this phase. You should nod, smile, and compliment them on the economy of their vision. This phase hones skills people need for more serious endeavors. Butt God help you if you actually use one of these "small" systems in production!

Post reply on HN