On 4/14/07, Andre Kuehne <[EMAIL PROTECTED]> 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


_______________________________________________
Chicken-users mailing list
[EMAIL PROTECTED]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to