Thread: Basic Xlib question

  1. #1
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300

    Basic Xlib question

    Not much decent documentation for Xlib.

    Has anyone here used it enough to know how to get the current window id? Or any window id? I am guessing I have to get all of them using XQueryTree() and choose.

    Is there a better way?
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  2. #2
    Registered User jeffcobb's Avatar
    Join Date
    Dec 2009
    Location
    Henderson, NV
    Posts
    875

    Surprising question..

    I would have thought the answer to such a basic thing would be...well everywhere and I am not seeing it. Let me dig through my books on X...

    Jeff
    C/C++ Environment: GNU CC/Emacs
    Make system: CMake
    Debuggers: Valgrind/GDB

  3. #3
    Registered User jeffcobb's Avatar
    Join Date
    Dec 2009
    Location
    Henderson, NV
    Posts
    875
    OK this looks like a long way around the block so to speak but here is a link to a code-fragment that does essentially that. With a little elbow grease it could be bent to your will: Its about a guy trying to externally manipulate open office windows by ID...
    Window ID

    Cheers.
    C/C++ Environment: GNU CC/Emacs
    Make system: CMake
    Debuggers: Valgrind/GDB

  4. #4
    Registered User
    Join Date
    Apr 2008
    Posts
    396
    When you create a window you get its id; you can also easily get the root window id via some macros as this is a particular case; you can get window ids by subscribing to any window-related event (creation, destruction, resizing, etc.). The last method is to walk the window tree as you suggested.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A basic math programming question
    By hebali in forum C Programming
    Replies: 38
    Last Post: 02-25-2008, 04:18 PM
  2. Basic question about GSL ODE func RK4
    By cosmich in forum Game Programming
    Replies: 1
    Last Post: 05-07-2007, 02:27 AM
  3. Basic question about RK4
    By cosmich in forum C++ Programming
    Replies: 0
    Last Post: 05-07-2007, 02:24 AM
  4. A very basic question
    By AshFooYoung in forum C Programming
    Replies: 8
    Last Post: 10-07-2001, 03:37 PM