How do toolkits interact with programs and with X?
by xlucas from LinuxQuestions.org on (#5K2RE)
There's something I never understood very well about toolkits, such as GTK+ and Qt, about X and about programs that run in desktop environments.
I imagine that there's the framebuffer; on top of it, X; on top of it, a toolkit and on top, the program one is using... but when I look at how programs get to X, I see that there are always calls to XLib functions, whether the programmer directly uses that or the compiler introduce them. Also, when I install programs, it looks like they run the same independently of which toolkit my desktop environment is based on. This makes me think that toolkits somehow stay "behind" X.
Say I install a program that was originally made for Qt, but I don't have Qt in my system; I have GTK+. Does this mean that Qt will be installed as a dependency? Or will the program adapt to GTK+ and run on it? Or maybe some programs are toolkit-agnostic, while others depend specifically on one of them?
I also notice that, if I make a program a directly call XLib functions, the toolkit appears to respond because the window is created with the same appearance as other desktop windows in that distribution. So does this mean that X somehow "calls" the toolkit?
Finally, say I would like to make my own very simple and minimally looking toolkit from scratch. Can I get other programs to use it when they run? That is, can I "plug it in X" somehow, so that it, instead of GTK+ or Qt, comes up when a window or button is to be drawn or to respond?
Very likely, some of you will find that I'm super confused about one or more points here, so if you have something to add about the topic, even if it's not exactly what I asked, it'd surely be very interesting to read too! Thanks a lot!
I imagine that there's the framebuffer; on top of it, X; on top of it, a toolkit and on top, the program one is using... but when I look at how programs get to X, I see that there are always calls to XLib functions, whether the programmer directly uses that or the compiler introduce them. Also, when I install programs, it looks like they run the same independently of which toolkit my desktop environment is based on. This makes me think that toolkits somehow stay "behind" X.
Say I install a program that was originally made for Qt, but I don't have Qt in my system; I have GTK+. Does this mean that Qt will be installed as a dependency? Or will the program adapt to GTK+ and run on it? Or maybe some programs are toolkit-agnostic, while others depend specifically on one of them?
I also notice that, if I make a program a directly call XLib functions, the toolkit appears to respond because the window is created with the same appearance as other desktop windows in that distribution. So does this mean that X somehow "calls" the toolkit?
Finally, say I would like to make my own very simple and minimally looking toolkit from scratch. Can I get other programs to use it when they run? That is, can I "plug it in X" somehow, so that it, instead of GTK+ or Qt, comes up when a window or button is to be drawn or to respond?
Very likely, some of you will find that I'm super confused about one or more points here, so if you have something to add about the topic, even if it's not exactly what I asked, it'd surely be very interesting to read too! Thanks a lot!