Why do I keep seeing people say this? People have been doing this for 30 years.
Fltk will let you do it in 700KB with no dependencies. (100KB if you're crafty). Juce, Qt, pyQt, opengl+imgui, opengl+nanogui all work well. There is also gtk, Tk, wxWindows ...
The idea isn't that you can't have some windows with text and buttons displayed with the same code on all platforms but that these windows, text and buttons wont look and behave like they are supposed to and expected by the users of each platform.
Now, outside of macOS this might not be much of a problem since Windows users were beaten into submission to accept any arbitrary look and behavior and Linux users never had a choice anyway.
"People complaining about buttons looking different" is a problem.
But it isn't just "buttons looking different", it is also "buttons behaving different". As an example (that i often find annoying in programs with long lists), under Windows Qt scrollbars do not behave like native Windows scrollbars: shift click in Windows should cause the scrollbar to scroll at the point you clicked (like middle click on most X toolkits) but Qt ignores that.
Also it is "buttons not integrating properly". On macOS it is very common for example to have system-wide addons (services i think they are called) that add additional functionality to text fields, like "search with google", "text to speech", "show definition", etc. This doesn't work when a toolkit does its own text field controls. You can also see a similar thing on Windows: GTK+ applications (e.g. GIMP) ignore the emoji panel in their text fields that appear with Windows+; but native text fields work fine with it.
Now note that i'm not saying this is something that matters for all sorts of applications or is always a deal breaker (especially nowadays that, as i wrote above, most users outside of macOS have been conditioned to accept these), but it isn't something that you can handwave away as "having a different shade" either.
Now note that i'm not saying this is something that matters for all sorts of applications or is always a deal breaker
The more serious issue that nobody here has yet mentioned is lack of accessibility, e.g. for blind users with screen readers, in many toolkits. I say that is a deal-breaker if you're developing any kind of application that someone is going to use in their job, education, or other important tasks, unless the task is already inherently visual in nature. Qt has passable accessibility on Windows, Mac,and desktop Linux. GTK is accessible as part of GNOME. Electron, for all its faults, is as accessible as Chrome (pretty good these days). FLTK, FOX, Nuklear, TK, and a thousand other toolkits have zero accessibility. I've grown weary of bringing this up, and some of you may be tired of seeing it, but I feel compelled to do everything I can to make sure nobody overlooks this point, lest someone develops an inaccessible application that prevents someone else from doing a job, taking a course, etc.
Edit: I realize that was a rant. What rubbed me the wrong way about your comment was the suggestion that the problems with cross-platform toolkits are mainly cosmetic things or extra functionality that only spoiled Mac users care about.
Uh, i think you need to read again what i wrote as i explicitly write that there are more issues than just cosmetic things and accessibility is one of these - i just brought simple examples that anyone can test by themselves right now.
But also yes, not every program has to care about these, including accessibility. An image editor or a level editor for some game or some internal and/or throwaway tool that has a very explicit "audience" has no reason to bother about these.
Nah I agree accessibility is super important, and exactly the thing you'd want a UI framework to encapsulate. I don't necessarily think it's essential--people should be able to determine their target userbase themselves--but if you want to be a mainstream UI framework that competes with Electron, it's table stakes.
Comments
Why do I keep seeing people say this? People have been doing this for 30 years.
Fltk will let you do it in 700KB with no dependencies. (100KB if you're crafty). Juce, Qt, pyQt, opengl+imgui, opengl+nanogui all work well. There is also gtk, Tk, wxWindows ...
Where are you getting this idea from?
The idea isn't that you can't have some windows with text and buttons displayed with the same code on all platforms but that these windows, text and buttons wont look and behave like they are supposed to and expected by the users of each platform.
Now, outside of macOS this might not be much of a problem since Windows users were beaten into submission to accept any arbitrary look and behavior and Linux users never had a choice anyway.
I've never seen this actually be a problem other than people complaining about buttons looking different.
If you are worried about the shading on your buttons then you must have had all your problems solved already.
"People complaining about buttons looking different" is a problem.
But it isn't just "buttons looking different", it is also "buttons behaving different". As an example (that i often find annoying in programs with long lists), under Windows Qt scrollbars do not behave like native Windows scrollbars: shift click in Windows should cause the scrollbar to scroll at the point you clicked (like middle click on most X toolkits) but Qt ignores that.
Also it is "buttons not integrating properly". On macOS it is very common for example to have system-wide addons (services i think they are called) that add additional functionality to text fields, like "search with google", "text to speech", "show definition", etc. This doesn't work when a toolkit does its own text field controls. You can also see a similar thing on Windows: GTK+ applications (e.g. GIMP) ignore the emoji panel in their text fields that appear with Windows+; but native text fields work fine with it.
Now note that i'm not saying this is something that matters for all sorts of applications or is always a deal breaker (especially nowadays that, as i wrote above, most users outside of macOS have been conditioned to accept these), but it isn't something that you can handwave away as "having a different shade" either.
The more serious issue that nobody here has yet mentioned is lack of accessibility, e.g. for blind users with screen readers, in many toolkits. I say that is a deal-breaker if you're developing any kind of application that someone is going to use in their job, education, or other important tasks, unless the task is already inherently visual in nature. Qt has passable accessibility on Windows, Mac,and desktop Linux. GTK is accessible as part of GNOME. Electron, for all its faults, is as accessible as Chrome (pretty good these days). FLTK, FOX, Nuklear, TK, and a thousand other toolkits have zero accessibility. I've grown weary of bringing this up, and some of you may be tired of seeing it, but I feel compelled to do everything I can to make sure nobody overlooks this point, lest someone develops an inaccessible application that prevents someone else from doing a job, taking a course, etc.
Edit: I realize that was a rant. What rubbed me the wrong way about your comment was the suggestion that the problems with cross-platform toolkits are mainly cosmetic things or extra functionality that only spoiled Mac users care about.
Uh, i think you need to read again what i wrote as i explicitly write that there are more issues than just cosmetic things and accessibility is one of these - i just brought simple examples that anyone can test by themselves right now.
But also yes, not every program has to care about these, including accessibility. An image editor or a level editor for some game or some internal and/or throwaway tool that has a very explicit "audience" has no reason to bother about these.
Nah I agree accessibility is super important, and exactly the thing you'd want a UI framework to encapsulate. I don't necessarily think it's essential--people should be able to determine their target userbase themselves--but if you want to be a mainstream UI framework that competes with Electron, it's table stakes.
Smalltalk? Pixel-identical on all supported platforms AFAIK.
https://en.wikipedia.org/wiki/Smalltalk#External_links
Pixel-identical to itself and nothing else. That is useless.