chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] iup cells draw callback


From: Martin DeMello
Subject: [Chicken-users] iup cells draw callback
Date: Wed, 14 Oct 2015 00:51:28 -0700

Hi,

I'm trying to port the chessboard example from IUP to chicken. The C code is here:

http://webserver2.tecgraf.puc-rio.br/iup/examples/C/cells_checkboard.c

I'm stuck when trying to add a draw callback - it crashes with 

Error: (callback-set!) callback has bad signature

The code is here: https://gist.github.com/martindemello/2f8ba4ccfebed3bd4650 or below:

(use iup)

(define (nlines self) 8)
(define (ncols self) 8)
(define (height self line) 50)
(define (width self col) 50)

(define (draw self i j xmin xmax ymin ymax canvas) 'default)

(define dlg
  (dialog
    (vbox
      (cells name: "Chessboard"
             height-cb: height
             width-cb: width
             nlines-cb: nlines
             ncols-cb: ncols
             draw-cb: draw)
      (button title: 'E&xit
              expand: 'Yes
              tip: "Close button"
              action: (lambda (self) 'close)))
    title: 'IUP))

(show dlg)
(main-loop)
(destroy! dlg)
(exit 0)

martin

reply via email to

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