X11 Programming

This is a discussion on X11 Programming within the Linux Programming forums, part of the Platform Specific Boards category; Hello World I'm unexpirienced in X11 programming and now I want to write some small application. It should create 4 ...

  1. #1
    Registered User
    Join Date
    Aug 2008
    Location
    Croatia
    Posts
    36

    X11 Programming

    Hello World

    I'm unexpirienced in X11 programming and now I want to write some small application.
    It should create 4 windows and each of them should be displayed on different X server.
    Questions:
    1\ Can it be done using X?
    2\ Which toolkits should I use...I'm thinking to use Motif...?
    3\ Should it be one process displaying all 4 windows or different process for each using sys.calls

    I guess that I'll have to use low level Xlib func. to get windows displayed on different machines...or...?

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    X windows in itself is capable of displaying at different machines. Try "xterm -display somemachine:0" where "somemachine" is not your own machine, and you'll see that it works.

    As to the rest of your questions, I'll leave it to someone with more experience in X development.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,892
    I believe xlib locks onto a single server connection, so you cannot have a single program that displays windows on different servers (computers). Unless you write the networking code yourself.
    However, you could launch multiple instances of your program, which all cooperate to form a single application.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  4. #4
    Registered User
    Join Date
    Aug 2008
    Location
    Croatia
    Posts
    36
    Quote Originally Posted by CornedBee View Post
    I believe xlib locks onto a single server connection, so you cannot have a single program that displays windows on different servers (computers). Unless you write the networking code yourself.
    However, you could launch multiple instances of your program, which all cooperate to form a single application.
    I though so...thanks!

  5. #5
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    I would use gtk rather than motif, but i guess that depends on where it's going...
    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

  6. #6
    Registered User
    Join Date
    Aug 2008
    Location
    Croatia
    Posts
    36
    Quote Originally Posted by MK27 View Post
    I would use gtk rather than motif, but i guess that depends on where it's going...
    We have some machines with Solaris, but I could get one with Linux just for that purpose.

    Application should be pretty simple, it would run 4 windows, one on local display and the rest on the remote Xservers(some old X-terminals);
    These terminals would then be used as the interface for some operators to alarm some other people in remote office on some event....
    Say, that person(operator) clicks the button in window displayed on that X-term and the window on that Xclient starts to blink with some warning message.

    Sorry for my bad and confusing english.

  7. #7
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    GTK is available for most Unix platforms (and Winows too, I think).

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. X11 scroll up
    By tytelizgal in forum C Programming
    Replies: 1
    Last Post: 10-23-2008, 03:10 AM
  2. x11 Question:
    By Kennedy in forum Linux Programming
    Replies: 1
    Last Post: 11-01-2007, 06:17 PM
  3. c++ linking problem for x11
    By kron in forum Linux Programming
    Replies: 1
    Last Post: 11-19-2004, 09:18 AM
  4. X11 api documentation?
    By EvBladeRunnervE in forum Linux Programming
    Replies: 6
    Last Post: 09-12-2003, 07:17 AM
  5. mouse handling and X11
    By mike9010 in forum Linux Programming
    Replies: 2
    Last Post: 07-05-2002, 10:49 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21