From alexr at cc.gatech.edu Sun May 1 13:27:49 2005 From: alexr at cc.gatech.edu (Alex Rudnick) Date: Sun, 01 May 2005 09:27:49 -0400 Subject: [lambda-gtk-devel] lambda-gtk with clisp? Message-ID: <4274D955.4000601@cc.gatech.edu> Hello, Rick and anybody else :) My semester's almost over, and once the summer starts, I'd like to try to make lambda-gtk work with clisp... Rick, I think you'd said something about having an email with helpful example code, towards this end? Yeah, but I'm about to have a lot of free time, and I'm going to make productive use of it :) Cheers :) -- -- alexr From taube at uiuc.edu Wed May 4 01:21:50 2005 From: taube at uiuc.edu (Rick Taube) Date: Tue, 3 May 2005 20:21:50 -0500 Subject: [lambda-gtk-devel] re: lambda-gtk with clisp? Message-ID: Hi Alex, my apologies for taking so long to respond. Here is the message I got from kenny tilton, including the tarball of the clisp code i think. you should be able to tell what they are using from clisp's ffi. I am happy to help out once school is out and the dust settles (two weeks or so...) --rick > From: Kenneth Tilton > Date: November 30, 2004 2:51:08 PM CST > To: Rick Taube > Subject: Fwd: Cells - Gtk > > Rick, > > I switched over to my Mac and was going to send gtk-ffi.lisp when I > got back to my XP box when I noticed this. It is the whole thing, but > only 122k, so what the heck. :) > > kenny > > Begin forwarded message: > >> From: Vasilis Margioulas >> Date: November 16, 2004 8:35:59 PM EST >> To: ktilton at nyc.rr.com >> Subject: Cells - Gtk >> >> Hi, >> In attached file is my work on gtk powered by cells using Clisp ffi >> (sory no uffi). >> If you find it usefull you can add it in cell-cultures repository >> feel free to contact for any comments or?sugestions. >> ? >> Vasilis Margioulas. >> ? >> PS: To load cells (cvs) in clisp i need?to change >> ???????cells/defpackage.lisp: (:import-from .....??? #-clisp >> #:slot-definition-name) >> ???????utils-kt/defpackage.lisp: (:export ...... #+clisp >> #:slot-definition-name) >> ???????so it will?be usefull if?you?change the above?in cvs tree. >> ? -------------- next part -------------- A non-text attachment was scrubbed... Name: cells-gtk.zip Type: application/zip Size: 125838 bytes Desc: not available URL: From tdukes at freescale.com Thu May 19 20:03:15 2005 From: tdukes at freescale.com (Todd Dukes) Date: Thu, 19 May 2005 15:03:15 -0500 Subject: [lambda-gtk-devel] gdk::pixmap-create-from-xpm-d argument type Message-ID: <200505192003.j4JK3FlJ021476@cde-tx32-ldt217.sps.mot.com> What type should the literal xpm data be for a call to gdk::pixmap-create-from-xpm-d. The data in c is shown below. Looking at the types defined with defalien-type in gtkffi-cmusbcl.lisp, the closest I see is: (defalien-type gchararray (* t)) How would this need to be altered to represent an array of character arrays? How then would the literal data appear in the lisp file? Is there any more documentation for sbcl-af other than the comments in the source distribution? Thanks for any help. Todd. /* XPM */ static char * plus_xpm[] = { "64 64 3 1", " c None", ". c #FFFFFF", "+ c #000000", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++", "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++", "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++", "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++", "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++", "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++", "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++", "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++", "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++", "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++", "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++", "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++", "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++", "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++", "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++", "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++", "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++", "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++", "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................", ".......................+++++++++++++++++++......................"}; From taube at uiuc.edu Fri May 20 17:29:22 2005 From: taube at uiuc.edu (Rick Taube) Date: Fri, 20 May 2005 12:29:22 -0500 Subject: [lambda-gtk-devel] gdk::pixmap-create-from-xpm-d argument type In-Reply-To: <200505192003.j4JK3FlJ021476@cde-tx32-ldt217.sps.mot.com> References: <200505192003.j4JK3FlJ021476@cde-tx32-ldt217.sps.mot.com> Message-ID: > > What type should the literal xpm data be for > a call to gdk::pixmap-create-from-xpm-d. hi it would need to be a foreign vector of c strings. Im not sure how this is done in sbcl but is possible, the gtkffi-cmusbcl.lisp file defines the function string->cstring which gets you partway there. > How then would the literal data appear in the lisp file? In Lisp it could be simply a list of strings: (defvar *myxpm* (list "64 64 3 1" [...] ".......................+++++++++++++++++++......................")) then write a function that takes the list of strings and allocates the vector w/ cstrings: (defun lisp-strings-to-string-vector (strs) (do-whatever strs)) > Is there any more documentation for sbcl-af other than the > comments in the source distribution? the sbcl manual has a pretty good section on their ffi. From tdukes at austin.rr.com Sun May 29 03:56:05 2005 From: tdukes at austin.rr.com (Todd Dukes) Date: Sat, 28 May 2005 22:56:05 -0500 Subject: [lambda-gtk-devel] passing lisp data to signal handlers Message-ID: I am trying to port a minesweeper game from C to lisp, just to learn a little about lambda-gtk. The buttons for the game are kept in a two dimensional array of these structures: (defstruct minesweeper-button button-state widget bombs-nearby has-bomb row column) I want to connect the button "clicked" signal to a handler like this: (g:signal-connect button "clicked" mine-button-clicked (aref *mines* column row)) The problem is that at runtime I get an error complaining that the data I passed to the signal-handler, ie. the (aref *mines* column row) is not of type (OR NULL SYSTEM-AREA-POINTER (ALIEN (* T))) I looked through the examples.lisp and downloaded cm-2.6.0 and looked at all the signal-connect calls, but found no examples of passing lisp data to the signal handler. I looked through the sb-alien section in the sbcl manual, but it doens't seem that converting lisp to a C representation so it could be accessed by other lisp occurred to them. I wanted to avoid having to create a C structure just to pass a couple of intergers to a signal. I guess for this particular case I could multiply the column by the number of rows and then add the row to that and decode it in the callback, but that seems a little hackish. I wanted to eliminate most of the globals once I got the program to work. Can anyone suggest a better way of sending this data to the callback. I can send the complete code if you would like. It is less than 600 lines without the xpm files. thanks, Todd.