From shaun.kruger at gmail.com Mon Jul 3 22:42:27 2006 From: shaun.kruger at gmail.com (Shaun Kruger) Date: Mon, 3 Jul 2006 16:42:27 -0600 Subject: [cells-gtk-devel] Documentation Message-ID: 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-) 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. -- J.R.R. Tolkien From kentilton at gmail.com Mon Jul 3 23:37:28 2006 From: kentilton at gmail.com (Ken Tilton) Date: Mon, 3 Jul 2006 19:37:28 -0400 Subject: [cells-gtk-devel] Documentation In-Reply-To: References: Message-ID: On 7/3/06, 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, 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-) 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. 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From peter.denno at nist.gov Tue Jul 4 00:03:41 2006 From: peter.denno at nist.gov (Peter Denno) Date: Mon, 3 Jul 2006 20:03:41 -0400 Subject: [cells-gtk-devel] Documentation In-Reply-To: References: Message-ID: <200607032003.42299.peter.denno@nist.gov> 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-) 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 From jeffrey.k.cunningham at boeing.com Thu Jul 6 19:56:01 2006 From: jeffrey.k.cunningham at boeing.com (Jeff Cunningham) Date: Thu, 6 Jul 2006 12:56:01 -0700 Subject: [cells-gtk-devel] CMUCL support? Message-ID: <20060706195601.GA6697@medea.sea.boeing.com> 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 > From peter.denno at nist.gov Fri Jul 7 01:34:36 2006 From: peter.denno at nist.gov (Peter Denno) Date: Thu, 6 Jul 2006 21:34:36 -0400 Subject: [cells-gtk-devel] CMUCL support? In-Reply-To: <20060706195601.GA6697@medea.sea.boeing.com> References: <20060706195601.GA6697@medea.sea.boeing.com> Message-ID: <200607062134.37352.peter.denno@nist.gov> 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 From peter.denno at nist.gov Fri Jul 7 02:02:17 2006 From: peter.denno at nist.gov (Peter Denno) Date: Thu, 6 Jul 2006 22:02:17 -0400 Subject: [cells-gtk-devel] CMUCL support?... answer In-Reply-To: <20060706195601.GA6697@medea.sea.boeing.com> References: <20060706195601.GA6697@medea.sea.boeing.com> Message-ID: <200607062202.18520.peter.denno@nist.gov> 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 From peter.denno at nist.gov Fri Jul 7 16:32:05 2006 From: peter.denno at nist.gov (Peter Denno) Date: Fri, 7 Jul 2006 12:32:05 -0400 Subject: [cells-gtk-devel] CMUCL support?... answer In-Reply-To: <20060707155609.GA9113@medea.sea.boeing.com> References: <20060706195601.GA6697@medea.sea.boeing.com> <20060707155609.GA9113@medea.sea.boeing.com> Message-ID: <200607071232.05469.peter.denno@nist.gov> 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 From peter.denno at nist.gov Fri Jul 7 16:52:05 2006 From: peter.denno at nist.gov (Peter Denno) Date: Fri, 7 Jul 2006 12:52:05 -0400 Subject: [cells-gtk-devel] CMUCL support?... answer In-Reply-To: <20060707155609.GA9113@medea.sea.boeing.com> References: <20060706195601.GA6697@medea.sea.boeing.com> <20060707155609.GA9113@medea.sea.boeing.com> Message-ID: <200607071252.06335.peter.denno@nist.gov> 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 From jeffrey.k.cunningham at boeing.com Fri Jul 7 17:18:08 2006 From: jeffrey.k.cunningham at boeing.com (Jeff Cunningham) Date: Fri, 7 Jul 2006 10:18:08 -0700 Subject: [cells-gtk-devel] CMUCL support?... answer In-Reply-To: References: <20060706195601.GA6697@medea.sea.boeing.com> <20060707155609.GA9113@medea.sea.boeing.com> Message-ID: <20060707171808.GC9260@medea.sea.boeing.com> 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 From jeffrey.k.cunningham at boeing.com Fri Jul 7 17:48:35 2006 From: jeffrey.k.cunningham at boeing.com (Jeff Cunningham) Date: Fri, 7 Jul 2006 10:48:35 -0700 Subject: [cells-gtk-devel] CMUCL support?... answ In-Reply-To: References: <20060706195601.GA6697@medea.sea.boeing.com> <20060707165851.GA9260@medea.sea.boeing.com> Message-ID: <20060707174835.GB9531@medea.sea.boeing.com> 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 From shaun.kruger at gmail.com Mon Jul 17 17:20:42 2006 From: shaun.kruger at gmail.com (Shaun Kruger) Date: Mon, 17 Jul 2006 11:20:42 -0600 Subject: [cells-gtk-devel] Modal Dialogs Message-ID: I am trying to figure out how to show a modal dialog and return a value. In this case the modal dialog is a login prompt. I have this: (defmodel login-prompt (window) () (:default-initargs :title "Login" :md-name :loginprompt :kids (list (mk-vbox :kids (list (mk-entry :md-name :username) ...other widgets... (mk-button :text "OK" :on-clicked (callback (widget event data) ...login processing... ...set return value/return from form... ))))))) I have login processing done for the moment (still a little bit about exception handling I need to mess with). I just don't know how to call the login prompt into existence and block execution until it returns. I know this shouldn't be as hard as it looks, but I am at a little bit of a disadvantage. I'm still learning cells, I havn't done much GTK, and I'm recovering from doing a couple of years of .NET programming. Any understanding you guys can provide would really help. Once again, I'll document whatever I can understand. Shaun -- 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. -- J.R.R. Tolkien From peter.denno at nist.gov Mon Jul 17 19:16:57 2006 From: peter.denno at nist.gov (Peter Denno) Date: Mon, 17 Jul 2006 15:16:57 -0400 Subject: [cells-gtk-devel] Modal Dialogs In-Reply-To: References: Message-ID: <200607171516.58665.peter.denno@nist.gov> Hi Shuan, How about something like this (from test-gtk/test-dialogs.lisp): (mk-button :label "Query for text" :on-clicked (callback (w e d) (let ((dialog (to-be (mk-message-dialog :md-name :rule-name-dialog :message "Type something:" :title "My Title" :message-type :question :buttons-type :ok-cancel :content-area (mk-entry :auto-aupdate t))))) (setf (text (fm^ :message-response)) (md-value dialog)))))) The callback on the button creates a dialog, to-be pops it up (I think) and it hangs around until you OK, at which point it grabs the value out of it an (in this case) displays it in a textview. On Monday 17 July 2006 13:20, Shaun Kruger wrote: > I am trying to figure out how to show a modal dialog and return a > value. In this case the modal dialog is a login prompt. > > I have this: > > (defmodel login-prompt (window) > () > (:default-initargs > > :title "Login" > :md-name :loginprompt > :kids > > (list (mk-vbox :kids (list > (mk-entry :md-name :username) > ...other widgets... > (mk-button :text "OK" > > :on-clicked > > (callback (widget event data) > ...login processing... > ...set return value/return from form... > ))))))) > > I have login processing done for the moment (still a little bit about > exception handling I need to mess with). I just don't know how to > call the login prompt into existence and block execution until it > returns. > > I know this shouldn't be as hard as it looks, but I am at a little bit > of a disadvantage. I'm still learning cells, I havn't done much GTK, > and I'm recovering from doing a couple of years of .NET programming. > > Any understanding you guys can provide would really help. Once again, > I'll document whatever I can understand. > > Shaun -- - Best regards, Peter From ln at bk.ru Tue Jul 18 14:37:51 2006 From: ln at bk.ru (Novikov Leonid) Date: Tue, 18 Jul 2006 18:37:51 +0400 Subject: [cells-gtk-devel] Modal Dialogs In-Reply-To: <200607171516.58665.peter.denno@nist.gov> References: <200607171516.58665.peter.denno@nist.gov> Message-ID: <44BCF23F.7040707@bk.ru> Peter Denno wrote: >Hi Shuan, > >How about something like this (from test-gtk/test-dialogs.lisp): > > (mk-button :label "Query for text" > :on-clicked > (callback (w e d) > (let ((dialog > (to-be > (mk-message-dialog > :md-name :rule-name-dialog > :message "Type something:" > :title "My Title" > :message-type :question > :buttons-type :ok-cancel > :content-area (mk-entry :auto-aupdate >t))))) > (setf (text (fm^ :message-response)) >(md-value dialog)))))) > >The callback on the button creates a dialog, to-be pops it up (I think) and it >hangs around until you OK, at which point it grabs the value out of it an (in >this case) displays it in a textview. > > > I did not want to use GtkMessageDialog and in my application has done as follows: (def-widget dialog (window) ((content-area :accessor content-area :initarg :content-area :initform nil) (eval-response :accessor eval-response :initarg :eval-response :initform (lambda (self resp) (print resp) )) (buttons :accessor buttons :initarg :buttons :initform nil) (buttons-id :accessor buttons-id :initarg :buttons-id :initform (c-in nil))) (markup) () :position :mouse :new-args nil ) (defmethod md-awaken :after ((self dialog)) (let ((response (gtk-dialog-run (id self)))) (funcall (eval-response self) self response) ) (gtk-widget-destroy (id self)) (gtk-object-forget (id self) self) (with-slots (content-area) self (when content-area (setf (md-value self) (md-value content-area)) (gtk-object-forget (id content-area) content-area)))) (def-c-output content-area ((self dialog)) (when new-value (to-be new-value) (let ((vbox (gtk-adds-dialog-vbox (id self)))) (gtk-box-pack-start vbox (id new-value) nil nil 5)))) (def-c-output buttons ((self dialog)) (when new-value (setf (buttons-id self) (mapcar #'(lambda (b) (gtk-dialog-add-button (id self) (car b) (car (cdr b)))) new-value)) ) ) (defmodel login-dialog (cgtk::dialog) ((username :accessor username :initarg :username :initform nil) (db-type :accessor db-type :initarg :db-type :initform nil) (db-other :accessor db-other :initarg :db-other :initform nil)) (:default-initargs :content-area (c? (make-instance 'login-window :username (username self) :db-type (db-type self) :db-other (db-other self))) :buttons '(("gtk-ok" -1) ("gtk-cancel" -2)) :eval-response (lambda (self x) (if (eql x -1) (setf (md-value (content-area self)) (funcall (eval (get-md-value (content-area self))) (content-area self))))) ) ) I think that makes sense add widget dialog in dialogs.lisp. And inherit rest dialogue widgets from it. I could do this work and send patch for dialogs.lisp. From shaun.kruger at gmail.com Tue Jul 18 19:30:13 2006 From: shaun.kruger at gmail.com (Shaun Kruger) Date: Tue, 18 Jul 2006 13:30:13 -0600 Subject: [cells-gtk-devel] Modal Dialogs In-Reply-To: References: <200607171516.58665.peter.denno@nist.gov> Message-ID: I am really missing something. Included is what I have defined for my login screen. The goal is for it to be callable from anywhere with (show-login-dialog). When it is called I get the following error: Error: Undefined function MM-APPS::ID called with arguments (LOGINPROMPT). 1 (continue) Try loading init again. 2 Give up loading init. 3 Try loading another file instead of init. 4 (abort) Return to level 0. 5 Return to top loop level 0. Type :b for backtrace, :c