chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] setting window title using xlib


From: felix winkelmann
Subject: Re: [Chicken-users] setting window title using xlib
Date: Sat, 14 Apr 2007 21:34:12 +0200

On 4/14/07, Andre Kuehne <address@hidden> wrote:
Dear all

Can someone give me an example of how to set a window title using the 
xlib-module?

Currently i have something like this:

(define (create-window display width height image-path)
   (let* ((screen (xdefaultscreen display))
         (root (xrootwindow display screen))
         (window (xcreatesimplewindow display root 0 0 width height 0
                                      (xblackpixel display screen)
                                      (xwhitepixel display screen)))
         (textprop #f))
     (assert window)
     (assert (not (= 0 (xstringlisttotextproperty (list image-path) 1 
textprop))))
     (assert textprop)
     (xsetwmname display window textprop)
     (xselectinput display window (bitwise-ior EXPOSUREMASK
                                              BUTTONPRESSMASK
                                              KEYPRESSMASK))
     (xmapwindow display window)
     window))

But acording to Xutil.h XStringListToTextProperty expects the stringlist to be 
a char**:

extern Status XStringListToTextProperty(
     char**              /* list */,
     int                 /* count */,
     XTextProperty*      /* text_prop_return */
);

How do i call xstringlisttotextproperty correctly in chicken?
Or is there some other way?


Currently, it is not possible to construct a pointer-array to Scheme strings
in Scheme. You have to construct the array in C (with strings allocated in
the C heap) and pass that pointer to the Xlib function.


cheers,
felix




reply via email to

[Prev in Thread] Current Thread [Next in Thread]