Low level window object and high level window object - Xwindows

This is a discussion on Low level window object and high level window object - Xwindows ; Hello Experts! I'm reading in a document about window system and in here I read this text that follows. "The X Window System distinguishes between a low level window object that describes a screen area and a high level window ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Low level window object and high level window object

  1. Low level window object and high level window object

    Hello Experts!

    I'm reading in a document about window system and in here I read this text
    that follows.

    "The X Window System distinguishes between a low level window object that
    describes a screen
    area and a high level window object that encompasses event handling and
    drawing on the
    window. It uses the term window for the low level object and widget for the
    high level. Because
    the functions of Xlib are too low level, another library of functions (the X
    Intrinsics) and objects
    (the X Widgets) has been build on top of it. Collectively the Intrinsics and
    the Widgets are known
    as the X Toolkit (Xt). Additional toolkits have been built on top of Xt, the
    most widely used being
    Motif. Therefore direct window creation is rarely found in X applications.
    Instead it is preferable
    to create a widget."

    What I don't understand is when they say that the low level object describe
    a screen area?

    If you for example create two programs the first one only by using low level
    object which you do by using the xlib api. The second program use high level
    object by using Toolkit from Xt or Motif.
    What will the difference be?

    In the text they say that high level encompasses event handling and drawing
    on the
    window. But how do you manage event handling and drawing on the sceen when
    you use low level object then?

    Many thanks in advance.

    //Tony



  2. Re: Low level window object and high level window object

    Tony Johansson wrote:
    >
    > What I don't understand is when they say that the low level object describe
    > a screen area?
    >
    > If you for example create two programs the first one only by using low level
    > object which you do by using the xlib api. The second program use high level
    > object by using Toolkit from Xt or Motif.
    > What will the difference be?


    A window is basically a way to reference a rectangular area of some
    display screen for the purpose of interacting with it. You can draw
    into it and you can ask the X server to let you know if the mouse
    pointer comes over it or is click on it and so forth.

    So say you want to write a program that just puts up a "button" with
    the label "Push Me" on it and exits when the user clicks on it.

    From the window level you have to create the window, determine what
    font to use, do something reasonable with the background, render the
    "Push Me" text in a reasonable place (e.g. centered) and register event
    at least one event handler to inform you when the "button" was clicked.

    From the Widget level your program says: create a PushButton with
    label "Push Me" and call this function (which you register) if it gets
    pushed. That's it. So just the simple need of a button illustrates
    the advantage of Widgets over working with windows. If you consider a
    complex GUI application that needs scrolling lists, adjustable panes,
    menus, trees and so forth the advantages becomes obvious.

    In addition to Widget GUI objects, Xt also abstracts away the
    complexities of coordinating your top level windows (shells) with the
    window manager. If you want an empty window with a particular title
    you have to work with the window manager to achieve that. If you work
    at the window level you have to deal directly with the window manger.
    If you leverage Xt most of the window manager esoterics are handle for
    you. You just set resources to identify what you want and Xt passes
    the info on to the window manger in the appropriate way.

    HTH,

    -- ced

    >
    > In the text they say that high level encompasses event handling and drawing
    > on the
    > window. But how do you manage event handling and drawing on the sceen when
    > you use low level object then?
    >
    > Many thanks in advance.
    >
    > //Tony
    >
    >



    --
    Chuck Dillon
    Senior Software Engineer
    NimbleGen Systems Inc.

+ Reply to Thread