From cells-devel at common-lisp.net Fri Feb 6 15:24:26 2009 From: cells-devel at common-lisp.net (cells-devel at common-lisp.net) Date: Fri, 06 Feb 2009 15:24:26 -0000 Subject: [cells-devel] Sales Order from walmart.com Message-ID: An HTML attachment was scrubbed... URL: From kentilton at gmail.com Sun Feb 15 14:31:51 2009 From: kentilton at gmail.com (Kenneth Tilton) Date: Sun, 15 Feb 2009 09:31:51 -0500 Subject: [cells-devel] cells-qx rizing Message-ID: <49982757.2020302@gmail.com> stand back argentina: proof of concept is in hand for cells-qx (cells + qooxdoo). kt From turbo24prg at web.de Sun Feb 15 15:23:23 2009 From: turbo24prg at web.de (=?ISO-8859-1?Q?Bastian_M=FCller?=) Date: Sun, 15 Feb 2009 16:23:23 +0100 Subject: [cells-devel] c-formula and setf Message-ID: <4998336B.9050408@web.de> Hi, I don't know if that has been discussed yet, but I've several use cases where I want to do sth. like that: A cell should be calculated by a formula if it isn't set to a value. I thought that's possible with (c-formula (:inputp t) ... ), which does calculate the slot by a formula and can be setf, but how is it possible to unset the setf value and let cells calculate it again? Example: A textbox is by default calculated by a formula. If the user enters sth. into it, that value is used. If the user clears the field of his input, the value should be calculated again. Maybe the c-formula ... approach is completely the wrong way or that's not possible at all. I've read the documentation and primer but couldn't find anything helpful. Sorry, I'm new to cells. Cheers, Bastian From ramarren at gmail.com Sun Feb 15 16:24:09 2009 From: ramarren at gmail.com (Ramarren) Date: Sun, 15 Feb 2009 17:24:09 +0100 Subject: [cells-devel] c-formula and setf Message-ID: > A cell should be calculated by a > formula if it isn't set to a value. I think the easiest way to achieve that would be to just use two cells, one c? and one c-in, and just have the former be equal to the latter if it is set, and to some formula if it is not. If you really want to have a consistent interface to the slot you should consider overriding accessor methods. Regards, Jakub From mikko.ahonen at grupposoftware.com Sun Feb 15 17:12:36 2009 From: mikko.ahonen at grupposoftware.com (Mikko Ahonen) Date: Sun, 15 Feb 2009 19:12:36 +0200 Subject: [cells-devel] How to force minimum delay between events in Cells? Message-ID: <5fd426040902150912k5b118f4fucbbae1df0c3836c4@mail.gmail.com> Hello, My first cells application was in production last week. I used LispWorks, CAPI and Cells to create an application which was used to verify names for people who are coming into an exhibition opening in the biggest museum in Finland. It was an touch screen application, and contained on-screen keyboard etc. It only took few days to complete and test the program. Everything worked perfectly! I had to cut few corners from the original specification, however. The keyboard was implemented using mouse button push and release events, which displayed the proper images representing the state of the buttons (button disabled, up or down). What I wanted was to force minimum delay after button down event before button up, so the key flashes just slightly longer. Any ideas what would be the best way to accomplish this? Best regards, Mikko Ahonen -------------- next part -------------- An HTML attachment was scrubbed... URL: From kentilton at gmail.com Sun Feb 15 17:48:53 2009 From: kentilton at gmail.com (Kenneth Tilton) Date: Sun, 15 Feb 2009 12:48:53 -0500 Subject: [cells-devel] c-formula and setf In-Reply-To: <4998336B.9050408@web.de> References: <4998336B.9050408@web.de> Message-ID: <49985585.7020308@gmail.com> Bastian M?ller wrote: > Hi, > > I don't know if that has been discussed yet, but I've several use cases > where I want to do sth. like that: A cell should be calculated by a > formula if it isn't set to a value. I thought that's possible with > (c-formula (:inputp t) ... ), which does calculate the slot by a formula > and can be setf, but how is it possible to unset the setf value and let > cells calculate it again? > > Example: A textbox is by default calculated by a formula. If the user > enters sth. into it, that value is used. If the user clears the field of > his input, the value should be calculated again. Could you just have?: (or (user-entered-value self) (calculated-value self)) One thing not clear to me is how you know they first indicate they want to enter a value and then communicate that they have decided against, and those things really come into play. Lemme know and I'll tell you how I would handle it. Pretty much I would avoid SETF as much as possible and end up with something still formulaic: (if (user-owns-value self) (editor-result self (key-input self)) (application-decides-value self)) > > Maybe the c-formula ... approach is completely the wrong way or that's > not possible at all. I've read the documentation and primer but couldn't > find anything helpful. Sorry, I'm new to cells. No problem. This is a common case where one really wants to think procedurally and it gets to be a little fun thinking declaratively. But really the interesting part is this change from user-owning to application-owning mode, so lemme know your protocol for that and I will do what I can. btw, as Jakub suggested often it is easier to divide and conquer: (or (user-value self) (application-decided-value self)) ...but I think you will end up with the same issue at some point of needing to know what state the field is in, so tell me more and I'll give it a shot. cheers, ken ps. might make a good use case. k From kentilton at gmail.com Sun Feb 15 18:04:00 2009 From: kentilton at gmail.com (Kenneth Tilton) Date: Sun, 15 Feb 2009 13:04:00 -0500 Subject: [cells-devel] How to force minimum delay between events in Cells? In-Reply-To: <5fd426040902150912k5b118f4fucbbae1df0c3836c4@mail.gmail.com> References: <5fd426040902150912k5b118f4fucbbae1df0c3836c4@mail.gmail.com> Message-ID: <49985910.9020003@gmail.com> Mikko Ahonen wrote: > Hello, > > My first cells application was in production last week. I used > LispWorks, CAPI and Cells to create an application which was used to > verify names for people who are coming into an exhibition opening in the > biggest museum in Finland. It was an touch screen application, and > contained on-screen keyboard etc. It only took few days to complete and > test the program. Everything worked perfectly! Awesome. We will declare you the Cells User of 2009. I pick up one a year. Someone get the lights, I am going fishing. :) > > I had to cut few corners from the original specification, however. The > keyboard was implemented using mouse button push and release events, > which displayed the proper images representing the state of the buttons > (button disabled, up or down). What I wanted was to force minimum delay > after button down event before button up, so the key flashes just > slightly longer. Any ideas what would be the best way to accomplish this? What I have done in the past is have a cell somewhere that gets internal-real-time stuffed into it, and then write rules that effectively terminate highlighting with: (and (mouse-up self)(> (- (current-time *app*) start) 250))) Where: *app* : an instance of some arbitrary class I make up to represent global application state (and usually has windows as children). In cells-qx I guess this will be a web session. Anyway... current-time : the aformentioned cell where get-internal-time gets stuffed start : a local variable set on mousedown But this works in Cello/Celtk because they sit in a tight loop polling for events and I can update the slot after each polling (they return at once if no events are available from Tcl). if you do not have this, does CAPI have some kind of timer mechanism you can leverage? GUIs often do. Then you have to do some clever coding to leverage the timer. I /think/ the example code for Celtk might show that. I know in the first code I did I used the timer because I was mimicking Peter Herth's example as closely as possible. If you get stuck lemme know. Maybe LW has a timer mechanism outside CAPI? kenny > > Best regards, > > Mikko Ahonen > > > ------------------------------------------------------------------------ > > _______________________________________________ > cells-devel site list > cells-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/cells-devel > > > ------------------------------------------------------------------------ > > > Internal Virus Database is out of date. > Checked by AVG - http://www.avg.com > Version: 8.0.176 / Virus Database: 270.10.13/1914 - Release Date: 1/24/2009 8:40 PM > From frgo at me.com Sun Feb 15 18:51:19 2009 From: frgo at me.com (Frank Goenninger) Date: Sun, 15 Feb 2009 19:51:19 +0100 Subject: [cells-devel] cells-qx rizing In-Reply-To: <49982757.2020302@gmail.com> References: <49982757.2020302@gmail.com> Message-ID: Am 15.02.2009 um 15:31 schrieb Kenneth Tilton: > stand back argentina: proof of concept is in hand for cells-qx > (cells + > qooxdoo). > > kt Oh man, can't wait to see the light ... ;-) Seriously: If you need a beta tester ... Cheers, Frank -- Frank Goenninger Cell: +49 175 4321058 E-Mail: frgo at me.com -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 832 bytes Desc: not available URL: From frgo at me.com Sun Feb 15 18:40:22 2009 From: frgo at me.com (Frank Goenninger) Date: Sun, 15 Feb 2009 19:40:22 +0100 Subject: [cells-devel] c-formula and setf In-Reply-To: <4998336B.9050408@web.de> References: <4998336B.9050408@web.de> Message-ID: Hi Bastian, Am 15.02.2009 um 16:23 schrieb Bastian M?ller: > Hi, > > I don't know if that has been discussed yet, but I've several use > cases > where I want to do sth. like that: A cell should be calculated by a > formula if it isn't set to a value. I thought that's possible with > (c-formula (:inputp t) ... ), which does calculate the slot by a > formula > and can be setf, but how is it possible to unset the setf value and > let > cells calculate it again? > > Example: A textbox is by default calculated by a formula. If the user > enters sth. into it, that value is used. If the user clears the > field of > his input, the value should be calculated again. > > Maybe the c-formula ... approach is completely the wrong way or that's > not possible at all. I've read the documentation and primer but > couldn't > find anything helpful. Sorry, I'm new to cells. > > Cheers, > Bastian Hi Bastian (wow - another Cells user in Germany ;-) - We're three now) As Kenny and Jakub have suggested one common solution I find myself using from time to time is: (defmd frgo () (entered-value (c-in nil)) (value (c? (or (^entered-value) (computed-value))))) (defun computed-value () ;;; Just making a simple function that fakes a computed value 'computed) (defun test-it () (let ((self (make-instance 'frgo))) (format t "~&Entered value: ~s~%" (^entered-value)) (format t "~&Value: ~s~%" (^value)) (setf (^entered-value) 'entered) (format t "~&Entered value: ~s~%" (^entered-value)) (format t "~&Value: ~s~%" (^value)))) Cheers Frank -- Frank Goenninger Cell: +49 175 4321058 E-Mail: frgo at me.com -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 832 bytes Desc: not available URL: From turbo24prg at web.de Mon Feb 16 16:36:29 2009 From: turbo24prg at web.de (=?ISO-8859-1?Q?Bastian_M=FCller?=) Date: Mon, 16 Feb 2009 17:36:29 +0100 Subject: [cells-devel] c-formula and setf In-Reply-To: References: <4998336B.9050408@web.de> Message-ID: <4999960D.2000807@web.de> Frank Goenninger wrote: Hi Frank, > (wow - another Cells user in Germany ;-) - We're three now) Heh. > As Kenny and Jakub have suggested one common solution I find myself > using from time to time is: > > (defmd frgo () > (entered-value (c-in nil)) > (value (c? (or (^entered-value) > (computed-value))))) > > (defun computed-value () ;;; Just making a simple function that fakes a > computed value > 'computed) > > (defun test-it () > (let ((self (make-instance 'frgo))) > (format t "~&Entered value: ~s~%" (^entered-value)) > (format t "~&Value: ~s~%" (^value)) > > (setf (^entered-value) 'entered) > (format t "~&Entered value: ~s~%" (^entered-value)) > (format t "~&Value: ~s~%" (^value)))) > That looks very good. When used with ":reader value" for the value slot and ":writer value" for the entered-value slot this works very well. Thanks a lot! Cheers, Bastian From achambers.home at googlemail.com Mon Feb 16 17:20:13 2009 From: achambers.home at googlemail.com (Andy Chambers) Date: Mon, 16 Feb 2009 17:20:13 +0000 Subject: [cells-devel] tcl event loop Message-ID: In the celtk source, this message is attached to the on-key-down of the tk-object slot. "Long story. Tcl C API weak for keypress events. This gets dispatched eventually thanks to DEFCOMMAND" Do you remember what this was all about? My first thought was that perhaps tk only generated keypress events instead of splitting them into keyup/keydown but the docs on the bind command seem to suggest you can catch them seperately. What's the skinny? Cheers, Andy From achambers.home at googlemail.com Mon Feb 16 17:22:12 2009 From: achambers.home at googlemail.com (Andy Chambers) Date: Mon, 16 Feb 2009 17:22:12 +0000 Subject: [cells-devel] tcl event loop In-Reply-To: References: Message-ID: On 2/16/09, Andy Chambers wrote: > > "Long story. Tcl C API weak for keypress events. This gets dispatched > eventually thanks to DEFCOMMAND" > > Do you remember what this was all about? My first thought was that > perhaps tk only generated keypress events instead of splitting them > into keyup/keydown but the docs on the bind command seem to suggest > you can catch them seperately. Scrap that. I've just found another comment in the source that explains it more fully. Sorry for the noise. -- Andy From kentilton at gmail.com Mon Feb 16 21:14:52 2009 From: kentilton at gmail.com (Kenneth Tilton) Date: Mon, 16 Feb 2009 16:14:52 -0500 Subject: [cells-devel] tcl event loop In-Reply-To: References: Message-ID: <4999D74C.6030709@gmail.com> Andy Chambers wrote: > On 2/16/09, Andy Chambers wrote: >> "Long story. Tcl C API weak for keypress events. This gets dispatched >> eventually thanks to DEFCOMMAND" >> >> Do you remember what this was all about? My first thought was that >> perhaps tk only generated keypress events instead of splitting them >> into keyup/keydown but the docs on the bind command seem to suggest >> you can catch them seperately. > > Scrap that. I've just found another comment in the source that explains it > more fully. Sorry for the noise. Not at all, and I would appreciate it if you would keep this quiet, I do not want to get a reputation for documenting anything. I had to go track it down myself -- ah, yes, keysyms vs. keypresses. You know I am doing cells-qx, yes? I saw something that says Safari will let you drag and drop a web page into a desktop application? How sick is that? I think OpenAIR just got a tad easier. kt From achambers.home at googlemail.com Wed Feb 25 22:43:34 2009 From: achambers.home at googlemail.com (Andy Chambers) Date: Wed, 25 Feb 2009 22:43:34 +0000 Subject: [cells-devel] Checkout all the cells discussion on the clojure list! Message-ID: http://groups.google.com/group/clojure/search?group=clojure&q=cells&qt_g=Search+this+group -- Andy