Shaun Kruger | 4 Jul 2006 00:42
Picon

Documentation

I haven't been able to find much documentation for cells-gtk.  Now
that I have a working cells-gtk environment (thanks for the new
tarball Peter) I'm trying to get into proper development.

I setup a wiki to start working on some documentation, but I have some
questions.

Was there documentation that I missed?
How do I produce a list of keyword arguments for each of the
(mk-<widgetname>) functions?
I can see the list when I pass in an invalid keyword and make-instance
throws an error, but I suspect there's a better way of doing it than
causing errors.
Is there anyone who would be willing to help me document cells-gtk?

If anyone would like to look at the wiki I set up it can be found at
http://www.cl-developer.com.  Cells-GTK looks like a great toolkit,
but it's really kind of useless if no one can find docs.

I also plan on putting up a tutorial or two as I do a little more with
this.  I still have a little bit to learn about using cells in general
too.

Shaun Kruger

--

-- 
Visit my blog at http://hackerlog.blogspot.com
=====================================================
If more of us valued food and cheer and song above hoarded gold, it would
be a merrier world.
(Continue reading)

Ken Tilton | 4 Jul 2006 01:37
Picon

Re: Documentation



On 7/3/06, Shaun Kruger <shaun.kruger <at> gmail.com> wrote:
I haven't been able to find much documentation for cells-gtk.  Now
that I have a working cells-gtk environment (thanks for the new
tarball Peter) I'm trying to get into proper development.

I setup a wiki to start working on some documentation,

ha-ha, there is a universal impulse of newcomers to document cells-related projects, and if you succeed you will be the first! I just did my bit by documenting UPPER and NEAREST (under upper only if anyone wants to propagate).

but I have some
questions.

Was there documentation that I missed?


GTk documentation? :) That's my excuse, anyway.


How do I produce a list of keyword arguments for each of the
(mk-<widgetname>) functions?

Joking aside, there should be a one-one mapping between Lisp classes and Gtk classes, and in this case between lisp slots/iitargs and Gtk configuration options. Perhaps a useful form of documentation is to hunt down the few exceptions from that rule, document those and then say "otherwise, Just Think Gtk".

As a design principle, while Lispniks usually like to remake the world (and third-party libraries) in thier own image, in the case of a GUI library wrapper there is an obvious benefit to being as transparent as possible. Twofold, really. First, if you know Gtk from C, you know Cells-Gtk. And, yes, the Gtk documentation is immediately applicable.


I can see the list when I pass in an invalid keyword and make-instance
throws an error, but I suspect there's a better way of doing it than
causing errors.

<g> I kinda prefer reacting to backtraces to trying to read the tortured technical prose of most writers.

Is there anyone who would be willing to help me document cells-gtk?

See "upper". :)


kt

<div>
<br><br><div>
<span class="gmail_quote">On 7/3/06, Shaun Kruger &lt;<a href="mailto:shaun.kruger <at> gmail.com">shaun.kruger <at> gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote">
I haven't been able to find much documentation for cells-gtk.&nbsp;&nbsp;Now<br>that I have a working cells-gtk environment (thanks for the new<br>tarball Peter) I'm trying to get into proper development.<br><br>I setup a wiki to start working on some documentation,
</blockquote>
<div>
<br>ha-ha, there is a universal impulse of newcomers to document cells-related projects, and if you succeed you will be the first! I just did my bit by documenting UPPER and NEAREST (under upper only if anyone wants to propagate).
<br>
</div>
<br><blockquote class="gmail_quote"> but I have some<br>questions.<br><br>Was there documentation that I missed?</blockquote>
<div>
<br><br>GTk documentation? :) That's my excuse, anyway.<br><br>
</div>
<br><blockquote class="gmail_quote">How do I produce a list of keyword arguments for each of the
<br>(mk-&lt;widgetname&gt;) functions?</blockquote>
<div>
<br>Joking aside, there should be a one-one mapping between Lisp classes and Gtk classes, and in this case between lisp slots/iitargs and Gtk configuration options. Perhaps a useful form of documentation is to hunt down the few exceptions from that rule, document those and then say "otherwise, Just Think Gtk".
<br><br>As a design principle, while Lispniks usually like to remake the world (and third-party libraries) in thier own image, in the case of a GUI library wrapper there is an obvious benefit to being as transparent as possible. Twofold, really. First, if you know Gtk from C, you know Cells-Gtk. And, yes, the Gtk documentation is immediately applicable.
<br><br>
</div>
<br><blockquote class="gmail_quote">I can see the list when I pass in an invalid keyword and make-instance<br>
throws an error, but I suspect there's a better way of doing it than<br>causing errors.</blockquote>
<div>
<br>&lt;g&gt; I kinda prefer reacting to backtraces to trying to read the tortured technical prose of most writers. 
<br>
</div>
<br><blockquote class="gmail_quote">Is there anyone who would be willing to help me document cells-gtk?</blockquote>
<div>
<br>See "upper". :)<br><br><br>kt<br>
</div>
</div>
<br>
</div>
Peter Denno | 4 Jul 2006 02:03
Favicon

Re: Documentation

On Monday 03 July 2006 18:42, Shaun Kruger wrote:
> I haven't been able to find much documentation for cells-gtk.  Now
> that I have a working cells-gtk environment (thanks for the new
> tarball Peter) I'm trying to get into proper development.
>
> I setup a wiki to start working on some documentation, but I have some
> questions.
>
> Was there documentation that I missed?

The gtk documentation is pretty good. As Kenny Tilton points out, cells-gtk 
should resemble it. 

http://developer.gnome.org/doc/API/2.0/gtk/index.html

> How do I produce a list of keyword arguments for each of the
> (mk-<widgetname>) functions?

You could look at the direct or effective slots in the clos objects. In fact, 
you could build the skeleton of such documentation by writing a program that 
printed these out...something like what you'd get with javadocs. Maybe 
somebody already has something like this for common lisp. 

Try (find-class 'cgtk:text-view) and use the inspector to get a sense of it. 

Also (if you aren't so much into wandering off into a documentation project) 
learn how slime can help you get around the code effectively. Between slime 
and the gtk docs you probably can figure it out. (Not to suggest that this 
can't be made much easier!)

> I can see the list when I pass in an invalid keyword and make-instance
> throws an error, but I suspect there's a better way of doing it than
> causing errors.
> Is there anyone who would be willing to help me document cells-gtk?

I can help a little if you can get it organized. 

> If anyone would like to look at the wiki I set up it can be found at
> http://www.cl-developer.com.  Cells-GTK looks like a great toolkit,
> but it's really kind of useless if no one can find docs.
>
> I also plan on putting up a tutorial or two as I do a little more with
> this.  I still have a little bit to learn about using cells in general
> too.

Sounds good.

>
> Shaun Kruger

--

-- 
- Best regards,
   Peter
Jeff Cunningham | 6 Jul 2006 21:56
Picon
Favicon

CMUCL support?


Hello;

I'm new to this list. I'm trying to install cells-gtk (6/30/2006
version) on a current CMUCL system and running into the "failure to
load xxx.so" problem. Has anyone worked this successfully?

First it was libcellsgtk.so but I got past this by creating a soft
link from /usr/local/lib to the libcellsgtk.so version provided in the
tarball.

Next I get this error:

; Byte Compiling Top-Level Form:
; Byte Compiling Top-Level Form:
; Converted LOAD-GTK-LIBS.
; Compiling DEFUN LOAD-GTK-LIBS:
; Byte Compiling Top-Level Form:
Unable to load foreign library: libgobject-2.0.so
Error flushed ...

This library exists in /usr/lib already, so I created a softlink in
/usr/local/lib as before, but it doesn't fix it. I also copied the
library into /usr/lib but no success.

Regards,

-- Jeff
>
Peter Denno | 7 Jul 2006 03:34
Favicon

Re: CMUCL support?

On Thursday 06 July 2006 15:56, Jeff Cunningham wrote:
> Hello;
>
> I'm new to this list. I'm trying to install cells-gtk (6/30/2006
> version) on a current CMUCL system and running into the "failure to
> load xxx.so" problem. Has anyone worked this successfully?
>
> First it was libcellsgtk.so but I got past this by creating a soft
> link from /usr/local/lib to the libcellsgtk.so version provided in the
> tarball.
>
> Next I get this error:
>
> ; Byte Compiling Top-Level Form:
> ; Byte Compiling Top-Level Form:
> ; Converted LOAD-GTK-LIBS.
> ; Compiling DEFUN LOAD-GTK-LIBS:
> ; Byte Compiling Top-Level Form:
> Unable to load foreign library: libgobject-2.0.so

This is exactly the problem I saw when testing the June 30 tarball. I might 
have a little more time to look at it tomorrow.

... or does someone here already know the solution.

> Error flushed ...
>
> This library exists in /usr/lib already, so I created a softlink in
> /usr/local/lib as before, but it doesn't fix it. I also copied the
> library into /usr/lib but no success.
>
> Regards,
>
> -- Jeff
>
> _______________________________________________
> cells-gtk-devel site list
> cells-gtk-devel <at> common-lisp.net
> http://common-lisp.net/mailman/listinfo/cells-gtk-devel

--

-- 
- Best regards,
   Peter
Peter Denno | 7 Jul 2006 04:02
Favicon

Re: CMUCL support?... answer

Hi Jeff,

in cffi/cfi-cmucl.lisp....

change this:
(defun %load-foreign-library (name)
  "Load the foreign library NAME."
  (sys::load-object-file name))

... to this:
(defun %load-foreign-library (name)
  "Load the foreign library NAME."
  (sys::load-object-file name)
  t)   ;<------- 

That's what I get from using an lightly tested version of cffi.

On Thursday 06 July 2006 15:56, Jeff Cunningham wrote:
> Hello;
>
> I'm new to this list. I'm trying to install cells-gtk (6/30/2006
> version) on a current CMUCL system and running into the "failure to
> load xxx.so" problem. Has anyone worked this successfully?
>
> First it was libcellsgtk.so but I got past this by creating a soft
> link from /usr/local/lib to the libcellsgtk.so version provided in the
> tarball.
>
> Next I get this error:
>
> ; Byte Compiling Top-Level Form:
> ; Byte Compiling Top-Level Form:
> ; Converted LOAD-GTK-LIBS.
> ; Compiling DEFUN LOAD-GTK-LIBS:
> ; Byte Compiling Top-Level Form:
> Unable to load foreign library: libgobject-2.0.so
> Error flushed ...
>
> This library exists in /usr/lib already, so I created a softlink in
> /usr/local/lib as before, but it doesn't fix it. I also copied the
> library into /usr/lib but no success.
>
> Regards,
>
> -- Jeff
>
> _______________________________________________
> cells-gtk-devel site list
> cells-gtk-devel <at> common-lisp.net
> http://common-lisp.net/mailman/listinfo/cells-gtk-devel

--

-- 
- Best regards,
   Peter
Peter Denno | 7 Jul 2006 18:32
Favicon

Re: CMUCL support?... answer

On Friday 07 July 2006 11:56, Jeff Cunningham wrote:
> That did it. Although I found I still needed the softlink in
> /usr/local/lib to libcellsgtk.so.

It is probably the case that /usr/local/lib is not in /etc/ld.so.conf ..

Oh wait, you are saying only libcellsgtk had this problem. hmmm. 

In cells-gtk/root/gtk-ffi/gtk-ffi.lisp you might try:

#+libcellsgtk
(cffi:define-foreign-library :cgtk
  (cffi-features:unix (merge-pathnames "libcellsgtk.so" 
#.*compile-file-pathname*))  ; <---- The m-p here is new. 
  (cffi-features:windows "libcellsgtk.dll")
  (cffi-features:darwin "libcellsgtk.dylib"))

I haven't tried it myself, but it might work. Andras had this working. I might 
have broken it. 

>
> The demo looks great.
>
> Thanks!

--

-- 
- Best regards,
   Peter
Peter Denno | 7 Jul 2006 18:52
Favicon

Re: CMUCL support?... answer

On Friday 07 July 2006 11:56, Jeff Cunningham wrote:
> That did it. Although I found I still needed the softlink in
> /usr/local/lib to libcellsgtk.so.

Regarding my last note (which hasn't been delivered to me yet, so I can't 
quote it. I should have said, (regarding change in 
cells-gtk/root/gtk-ffi/gtk-ffi.lisp)

#+libcellsgtk
(cffi:define-foreign-library :cgtk
  (cffi-features:unix #.(merge-pathnames "libcellsgtk.so" 
*compile-file-pathname*))
  (cffi-features:windows #.(merge-pathnames "libcellsgtk.dll" 
*compile-file-pathname*))
  (cffi-features:darwin #.(merge-pathnames "libcellsgtk.dylib" 
*compile-file-pathname*)))

Note that #. has moved to outside the merge-pathnames.

I tried this on cmucl. It works for me.

>
> The demo looks great.
>
> Thanks!

--

-- 
- Best regards,
   Peter
Jeff Cunningham | 7 Jul 2006 19:18
Picon
Favicon

Re: CMUCL support?... answer


On Fri, Jul 07, 2006 at 09:53:11AM -0700, Peter Denno wrote:
> On Friday 07 July 2006 11:56, Jeff Cunningham wrote:
> Regarding my last note (which hasn't been delivered to me yet, so I can't 
> quote it. I should have said, (regarding change in 
> cells-gtk/root/gtk-ffi/gtk-ffi.lisp)
> 
> #+libcellsgtk
> (cffi:define-foreign-library :cgtk
>   (cffi-features:unix #.(merge-pathnames "libcellsgtk.so" 
> *compile-file-pathname*))
>   (cffi-features:windows #.(merge-pathnames "libcellsgtk.dll" 
> *compile-file-pathname*))
>   (cffi-features:darwin #.(merge-pathnames "libcellsgtk.dylib" 
> *compile-file-pathname*)))
> 
> Note that #. has moved to outside the merge-pathnames.
> I tried this on cmucl. It works for me.

It works now without the softlink. 
Thanks!

-- Jeff

Jeff Cunningham | 7 Jul 2006 19:48
Picon
Favicon

Re: CMUCL support?... answ

On Fri, Jul 07, 2006 at 10:39:25AM -0700, Peter Denno wrote:
> Jeff, 
> 
> This corresponds to my first suggestion, where the #. was not outside the 
> merge-pathnames, right?
> 

Peter,

I'm sorry, I should have been more clear. It was your second
suggestion - placing the #. outside the merge-pathnames - that worked
for me.

--Jeff

Gmane