XCreateWindow question - Xwindows

This is a discussion on XCreateWindow question - Xwindows ; I'm playing around with the Xlib (for the fun of it), and I've written a simple proc to create a window and display some text, draw some lines, etc. For example: win = XCreateSimpleWindow(display, RootWindow(display, screen_num), win_x, win_y, width, height, ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: XCreateWindow question

  1. XCreateWindow question

    I'm playing around with the Xlib (for the fun of it), and I've written a
    simple proc to create a window and display some text, draw some lines, etc.

    For example:
    win = XCreateSimpleWindow(display, RootWindow(display, screen_num),
    win_x, win_y, width, height, win_border_width,
    BlackPixel(display, screen_num),
    WhitePixel(display, screen_num));

    I'm running XWindow 4.3.0 with KDE 3.1. Because I called the Xlib function
    specifically, I expected to get a plain window with a thin border. Instead,
    I got the window in the current KDE style with the Keramik border (it's a
    pixmap, right?). Although I specified certain colors for the background, I
    was locked into Keramik's configuration. I also had no control over where
    the window appeared on the screen.

    I had the same problem with XCreateWindow.

    Obviously, I have to specify some other parameters for the window
    construction. Is this a specification in the GC or valuemask? Is there a
    seperate function to control the wind borders?

    Any insight would be appreciated.

    Thanks!


    --

    Tom Bitsky, Jr
    tbj@automateddesign.com

    Automated Design Corporation
    P: (630) 783-1150 F: (630) 783-1159



  2. Re: XCreateWindow question

    Thomas Junior wrote:

    > I'm playing around with the Xlib (for the fun of it), and I've written a
    > simple proc to create a window and display some text, draw some lines, etc.
    >
    > For example:
    > win = XCreateSimpleWindow(display, RootWindow(display, screen_num),
    > win_x, win_y, width, height, win_border_width,
    > BlackPixel(display, screen_num),
    > WhitePixel(display, screen_num));
    >
    > I'm running XWindow 4.3.0 with KDE 3.1. Because I called the Xlib function
    > specifically, I expected to get a plain window with a thin border. Instead,
    > I got the window in the current KDE style with the Keramik border (it's a
    > pixmap, right?). Although I specified certain colors for the background, I
    > was locked into Keramik's configuration. I also had no control over where
    > the window appeared on the screen.


    Read the chapter on window managers and the ICCCM. The window manager
    manages the desktop and so takes certain liberties with your windows
    unless you ask it not to by asserting the override redirect flag in
    your window's attributes.

    When you map your window KDE reparents it inside of wrapper windows
    that it owns and then it decorates it. What you are seeing is not the
    border you ask for in the call but rather the decoration borders that
    KDE adds. Your border should be inside the decorations.

    Placement is similar. In the presence of a window manager your window
    placement is subject to the window manager's layout policies unless you
    use override redirect.

    You probably don't want to use override redirect since the window
    manager will completely ignore your window and you will be annoyed to
    find that you can't give it the mouse or keyboard focus.

    What you need to do is use window manager hints to ask the window
    manager to decorate your window in a certain way or to place it in a
    certain place. Again read up on window managers and the ICCCM. Also
    see the XSetWM* functions.

    -- ced

    >
    > I had the same problem with XCreateWindow.
    >
    > Obviously, I have to specify some other parameters for the window
    > construction. Is this a specification in the GC or valuemask? Is there a
    > seperate function to control the wind borders?
    >
    > Any insight would be appreciated.
    >
    > Thanks!
    >
    >
    > --
    >
    > Tom Bitsky, Jr
    > tbj@automateddesign.com
    >
    > Automated Design Corporation
    > P: (630) 783-1150 F: (630) 783-1159
    >
    >



    --
    Chuck Dillon
    Senior Software Engineer
    NimbleGen Systems Inc.


  3. Re: XCreateWindow question

    Thanks. A lot of good information.

    When you say read the chapter, what resource are you referring to? Just the
    man pages on my machine or the KDE references?

    Thanks again,
    Tom

    "Chuck Dillon" wrote in message
    news:boei6s$la7$1@grandcanyon.binc.net...
    > Thomas Junior wrote:
    >
    > > I'm playing around with the Xlib (for the fun of it), and I've written a
    > > simple proc to create a window and display some text, draw some lines,

    etc.
    > >
    > > For example:
    > > win = XCreateSimpleWindow(display, RootWindow(display, screen_num),
    > > win_x, win_y, width, height,

    win_border_width,
    > > BlackPixel(display, screen_num),
    > > WhitePixel(display, screen_num));
    > >
    > > I'm running XWindow 4.3.0 with KDE 3.1. Because I called the Xlib

    function
    > > specifically, I expected to get a plain window with a thin border.

    Instead,
    > > I got the window in the current KDE style with the Keramik border (it's

    a
    > > pixmap, right?). Although I specified certain colors for the background,

    I
    > > was locked into Keramik's configuration. I also had no control over

    where
    > > the window appeared on the screen.

    >
    > Read the chapter on window managers and the ICCCM. The window manager
    > manages the desktop and so takes certain liberties with your windows
    > unless you ask it not to by asserting the override redirect flag in
    > your window's attributes.
    >
    > When you map your window KDE reparents it inside of wrapper windows
    > that it owns and then it decorates it. What you are seeing is not the
    > border you ask for in the call but rather the decoration borders that
    > KDE adds. Your border should be inside the decorations.
    >
    > Placement is similar. In the presence of a window manager your window
    > placement is subject to the window manager's layout policies unless you
    > use override redirect.
    >
    > You probably don't want to use override redirect since the window
    > manager will completely ignore your window and you will be annoyed to
    > find that you can't give it the mouse or keyboard focus.
    >
    > What you need to do is use window manager hints to ask the window
    > manager to decorate your window in a certain way or to place it in a
    > certain place. Again read up on window managers and the ICCCM. Also
    > see the XSetWM* functions.
    >
    > -- ced
    >
    > >
    > > I had the same problem with XCreateWindow.
    > >
    > > Obviously, I have to specify some other parameters for the window
    > > construction. Is this a specification in the GC or valuemask? Is there a
    > > seperate function to control the wind borders?
    > >
    > > Any insight would be appreciated.
    > >
    > > Thanks!
    > >
    > >
    > > --
    > >
    > > Tom Bitsky, Jr
    > > tbj@automateddesign.com
    > >
    > > Automated Design Corporation
    > > P: (630) 783-1150 F: (630) 783-1159
    > >
    > >

    >
    >
    > --
    > Chuck Dillon
    > Senior Software Engineer
    > NimbleGen Systems Inc.
    >




  4. Re: XCreateWindow question

    Thomas Junior wrote:
    > Thanks. A lot of good information.
    >
    > When you say read the chapter, what resource are you referring to? Just the
    > man pages on my machine or the KDE references?


    The usual reference is a set of books on X11 from O'Reilly and
    Associates. It includes programmer's guides and references for Xlib,
    Xt and Motif. You can get them at ora.com.

    If you don't want to make such an investment I suggest you check out
    the compilation of on-line information that Ken Lee maintains at:
    http://www.rahul.net/kenton/xsites.framed.html
    The ICCCM is at:
    http://tronche.com/gui/x/icccm/

    Also the FAQs for c.w.x* can be found at faqs.org.

    -- ced

    >
    > Thanks again,
    > Tom
    >
    > "Chuck Dillon" wrote in message
    > news:boei6s$la7$1@grandcanyon.binc.net...
    >
    >>Thomas Junior wrote:
    >>
    >>
    >>>I'm playing around with the Xlib (for the fun of it), and I've written a
    >>>simple proc to create a window and display some text, draw some lines,

    >
    > etc.
    >
    >>>For example:
    >>>win = XCreateSimpleWindow(display, RootWindow(display, screen_num),
    >>> win_x, win_y, width, height,

    >
    > win_border_width,
    >
    >>> BlackPixel(display, screen_num),
    >>> WhitePixel(display, screen_num));
    >>>
    >>>I'm running XWindow 4.3.0 with KDE 3.1. Because I called the Xlib

    >
    > function
    >
    >>>specifically, I expected to get a plain window with a thin border.

    >
    > Instead,
    >
    >>>I got the window in the current KDE style with the Keramik border (it's

    >
    > a
    >
    >>>pixmap, right?). Although I specified certain colors for the background,

    >
    > I
    >
    >>>was locked into Keramik's configuration. I also had no control over

    >
    > where
    >
    >>>the window appeared on the screen.

    >>
    >>Read the chapter on window managers and the ICCCM. The window manager
    >>manages the desktop and so takes certain liberties with your windows
    >>unless you ask it not to by asserting the override redirect flag in
    >>your window's attributes.
    >>
    >>When you map your window KDE reparents it inside of wrapper windows
    >>that it owns and then it decorates it. What you are seeing is not the
    >>border you ask for in the call but rather the decoration borders that
    >>KDE adds. Your border should be inside the decorations.
    >>
    >>Placement is similar. In the presence of a window manager your window
    >>placement is subject to the window manager's layout policies unless you
    >> use override redirect.
    >>
    >>You probably don't want to use override redirect since the window
    >>manager will completely ignore your window and you will be annoyed to
    >>find that you can't give it the mouse or keyboard focus.
    >>
    >>What you need to do is use window manager hints to ask the window
    >>manager to decorate your window in a certain way or to place it in a
    >>certain place. Again read up on window managers and the ICCCM. Also
    >>see the XSetWM* functions.
    >>
    >>-- ced
    >>
    >>
    >>>I had the same problem with XCreateWindow.
    >>>
    >>>Obviously, I have to specify some other parameters for the window
    >>>construction. Is this a specification in the GC or valuemask? Is there a
    >>>seperate function to control the wind borders?
    >>>
    >>>Any insight would be appreciated.
    >>>
    >>>Thanks!
    >>>
    >>>
    >>>--
    >>>
    >>>Tom Bitsky, Jr
    >>>tbj@automateddesign.com
    >>>
    >>> Automated Design Corporation
    >>>P: (630) 783-1150 F: (630) 783-1159
    >>>
    >>>

    >>
    >>
    >>--
    >>Chuck Dillon
    >>Senior Software Engineer
    >>NimbleGen Systems Inc.
    >>

    >
    >
    >



    --
    Chuck Dillon
    Senior Software Engineer
    NimbleGen Systems Inc.


+ Reply to Thread