All operating systems are written in C. So, any application, console/GUI you write in C is the standard way of writing for the operating system.
GTK is a popular GUI that works with C .
There is a large number of GUI libraries for Haskell. Unfortunately there is no standard one and all are more or less incomplete.
In order to create a window you'll need to interface with whatever windowing system is currently present on your operating system. This will either require system calls if the window manager runs in kernel space (as is the case in Windows) or some sort of interprocess communication for user space window managers (like X). To create the window from scratch, you'll need to read up on how these window managers work and what protocols they use. In the case of X, it shouldn't be too hard to find resources on how the protocol works. In the case of Windows, your only option might be to use the API, since the internals of the window manager are proprietary.
You could try perusing the source code to MenuetOS - I believe it's written entirely in assembly and it has a GUI. Of course, this won't work if you're trying to write a program that runs on Windows, Linux, etc. But if you want to avoid all external libraries, including interfacing with Windows, you will have to run on the bare metal.
If you are crazy enough to do this thing in assembly go ahead and install masm32 , it can do basic GUIs like windows/messageboxes etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With