Thread: Understanding X Events and widgets better

  1. #1
    Registered User
    Join Date
    Feb 2019
    Posts
    2

    Question Understanding X Events and widgets better

    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.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    I'd recommend google "x11 programming examples".
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to add Sidebar Widgets in tumblr?
    By fagers91 in forum Tech Board
    Replies: 21
    Last Post: 08-25-2015, 09:17 AM
  2. understanding events
    By jefcoatv in forum C# Programming
    Replies: 1
    Last Post: 04-02-2011, 05:28 PM
  3. widgets in fedora7
    By munna_dude in forum Linux Programming
    Replies: 1
    Last Post: 10-24-2007, 01:41 AM
  4. GTK+ packing widgets..
    By BobS0327 in forum Linux Programming
    Replies: 2
    Last Post: 04-26-2006, 10:18 AM
  5. Widgets with OpenGL, DirectX or SDL?
    By nickname_changed in forum Game Programming
    Replies: 1
    Last Post: 09-25-2004, 11:33 PM

Tags for this Thread