A question about understanding - Xwindows

This is a discussion on A question about understanding - Xwindows ; Hello! I'm reading in a document about Window system and here I have found something that I want to ask about. The document say the following: "In X the term "window" is used to refer to a server window object. ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: A question about understanding

  1. A question about understanding

    Hello!

    I'm reading in a document about Window system and here I have found
    something that I want to ask about.
    The document say the following:
    "In X the term "window" is used to refer to a server window object. A window
    in X has a geometry parameters,attributes and properties."
    "Widget is a client window object that includes a reference to a server
    window object."
    Here I have an API for creating a window first and then creating a widget

    Window XCreateSimpleWindow(Display, /*pointer to the server */
    Window, /*parent*/
    int, int,
    /*x,y of upper left corner */
    int, int,
    /*width and height*/
    int,
    /*border width*/
    unsigned long, /*border
    color*/
    unsigned long)
    /*background color*/


    Widget XtVaCreateWidget( String, /* widget name */
    WidgetClass, /*widget
    class */
    Widget, /*parent*/
    ArgList, /*array
    of structure with parameters*/
    Cardinal) /*length
    of array in previous argument*/

    In the document that I'm reading it says Widget is a client window object
    that includes a reference to a server window object
    Now to my question where in the API XtVaCreateWidget is the reference to a
    server window object? that the document is talking about.
    Why in X does window refer to server window object?
    Why is a widget client window object.?
    I can't understand why they call it a server window object in one case and a
    client window object in the other case.

    //Tony



  2. Re: A question about understanding

    Tony Johansson wrote:

    > Hello!


    Hi!

    >
    >
    >
    > In the document that I'm reading it says Widget is a client window object
    > that includes a reference to a server window object
    > Now to my question where in the API XtVaCreateWidget is the reference to a
    > server window object? that the document is talking about.
    > Why in X does window refer to server window object?
    > Why is a widget client window object.?
    > I can't understand why they call it a server window object in one case and a
    > client window object in the other case.
    >


    It is unfortunate if the author used such terminology. The word window
    is pretty heavily overloaded and so can confuse things when you start
    out with any windowing system. People use window to refer to X server
    side windows, application windows on a desktop screen (e.g. "an xterm
    window"), the MicroSoft's OS and just about anything else that pops up
    on a GUI screen.

    A Widget is not a Window. A Widget is a client side object closely
    associated with underlying server side Windows. Widgets exist only as
    logical entities in the client code. X servers don't know anything
    about widgets.

    Windows are logical objects that exist only on the X server side.
    Clients only have IDs to be used to reference them. Widgets (client
    side) hold reference IDs to whatever Windows they need.

    You don't create a Window and than wrap a Widget around it. You create
    a Widget and use it and if you are lucky you don't need to know or care
    about the Windows it has underneath the covers.

    Widgets create one (or more!) Windows as they need them. When you
    create a Widget it's Window normally doesn't yet exist. It's not until
    later that the Widget code creates the window(s) it needs. The Widget
    user can use XtWindow(widget) to get the ID of "core" Window associated
    with a Widget. That is the most useful Window associated with the
    Widget but not necessarily the only Window.



    HTH,

    -- ced


    --
    Chuck Dillon
    Senior Software Engineer
    NimbleGen Systems Inc.

+ Reply to Thread