Making Simple X11 GUI Window in C on Linux

preview_player
Показать описание
In this video I will demonstrate how you can use the X11 Library to create a graphical window on the screen using the C Programming Language.

X11 Dev Dependencies (Debian/Ubuntu package names):
- libx11-dev
- libx11-doc

Online X11 doc I used in the video:

Code:
Рекомендации по теме
Комментарии
Автор

I like how this is easier than Windows API... You know, the operating system known for it's GUI

emdeetee
Автор

For a game engine, I had to make a windowing library using X11...
It was painful.
I wish this video existed 2 years ago, but either way, I love your content!
Nice work!

plasmarade
Автор

good to see people take interest in this type of thing still. i am writing a desktop environment for x11 using xcb for my final year project. even if the technologies are old, and xlib is vastly inferior due to architecture reasons to xcb, this is something people can still very much use to create some perhaps rudimentary applications. thank you for the video.

freedomgoddess
Автор

Normal people would never see it that way, but this is really hardcore ! Fascinating !

cornjulio
Автор

Such a tight demo. Extraordinary content, thanks so very much.

modolief
Автор

Interesting! Less code than with the simple GUI window you created on Windows but far more reading of the docs. lol I've never actually written any GUI code in C, so both videos were fun to watch! Thanks for posting!

TheCocoaDaddy
Автор

Really Nice Video. And thank you for the references

karanmungra
Автор

Another great vid, as always! Thanks nir!

liquidmobius
Автор

You made me wanna learn C with this simple video

geavenxdd
Автор

Can I ask for a simple Wayland GUI Window on Linux? :)

gSys
Автор

Wow, the best tutorial I ever seen of introduction to GUI in C. Regardless it's x11 anyway :).

davidenglish
Автор

Love your videos, could you please make the font bigger and change the color scheme for one with a better contrast? It's hard to read on smaller screens

Macpl
Автор

Thanks! Good content again! Could you eventually also demonstrate the concept of x windows client and server in this context?

StefanWelebny
Автор

As always great video Nir..

Unless I missed something, it would be great if you can explain how this very example works at a high level. I see the term x11 server thrown around, but couldn't really grok it yet.

x11 is like a server between kernel and user-space application which takes the commands and would draw stuff on the window?!

GK-rldu
Автор

Hello, I like your videos, they show some concepts in a simple and quick way. Maybe you can help me.I want to create a program that allows me to password protect any program I have installed to run (Chrome, Steam, etc.), that is, when I click on a program to open it, a dialog box appears asking me to enter a password. If it is correct, the program opens, otherwise it does not. I want to do all this for Windows, I have been looking for what processes or libraries I should use to listen to an event when a program starts but I am a little confused, I don't know where to start. Maybe you can help me with that.

bxavier
Автор

you make cool coding videos. i would like to know whether you have a video introduce your coding env/ide etc. i like how vim auto-complete and split term and man pages. will you talk about your vim plugins...etc

honeymak
Автор

Great video, have you considered implementing a simple stack-based virtual machine in one of your videos?

I feel like it would be simple and self-contained enough for your style of video.

jawad
Автор

general question: where do I learn about all of this stuff, I suppose the decumnetation but that place is a mess.

mianaliahmed
Автор

When I try to compile it, I get an error message (on the #include line) that says "X11/xlib.h: No such file or directory". But I've installed the packages listed in the description. Do you know why this is happening?

Edit: Ah! I typed "xlib.h" instead of "Xlib.h". It's hard for me to see the dark magenta text on the black background in the video. Well, hopefully this helps anyone who has the same issue.

unchaynd
Автор

Wow, what distro Linux/DE do you use?

vanvothe