I am looking at getting a better understanding in regards to writing a C program and how events loops interact with widgets (Buttons, textboxes, combo boxes) or other clickable items within a window work. I can understanding the mechanism of the main loop of Xlib (or XCB) and a click or movement of the mouse. But having difficulty understanding how, say a GUI toolkit would use this if you had a large number of widgets on a window.
If I was to write one (or as I am doing understand it).
Would it get the X and Y position from the click or movement, and check each widget on the window seeing if the X,Y co-ordinate is in the rectangle area of it. Would not this take to long for say movements of the mouse? Or is there another way that it is done?
As GUI toolkits are normally so large to scroll through, can anyone recommend where I could learn more about this or give me some basic understanding where to start.