From achambers.home at googlemail.com Fri Aug 14 13:52:26 2009 From: achambers.home at googlemail.com (Andy Chambers) Date: Fri, 14 Aug 2009 14:52:26 +0100 Subject: [cells-devel] bug in celtk Message-ID: Hey All, There seems to be a strange bug in celtk. I'm looking into it but wondered if any of you guys had any clues. Celtk seems to be delaying the evaluation of an "on-command" procedure until the next "on-command" event is generated. You can see this in the example ltktest-ci. If you start that, and click the "Hallo" button, then the "Wald" button, then the "Hallo" button, you'll see what I'm talking about. I've made a few changes to my local copy so it might just be me but it would be interesting to find out if anyone else can confirm this behaviour. Cheers, Andy From kentilton at gmail.com Fri Aug 14 14:07:54 2009 From: kentilton at gmail.com (Kenneth Tilton) Date: Fri, 14 Aug 2009 10:07:54 -0400 Subject: [cells-devel] bug in celtk In-Reply-To: References: Message-ID: <4A856FBA.80109@gmail.com> I do not have that code over here. Maybe FG committed something. Maybe if you can describe it better I can figure out what must be going on. I am not aware of any problems at the core level, but then again I do not have that code so maybe something new is going on. kt Andy Chambers wrote: > Hey All, > > There seems to be a strange bug in celtk. I'm looking into it but > wondered if any of you guys had any clues. > > Celtk seems to be delaying the evaluation of an "on-command" procedure > until the next "on-command" event > is generated. You can see this in the example ltktest-ci. If you > start that, and click the "Hallo" button, then > the "Wald" button, then the "Hallo" button, you'll see what I'm talking about. > > I've made a few changes to my local copy so it might just be me but it > would be interesting to find out if > anyone else can confirm this behaviour. > > Cheers, > Andy > > _______________________________________________ > cells-devel site list > cells-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/cells-devel > > > ------------------------------------------------------------------------ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.5.392 / Virus Database: 270.13.54/2300 - Release Date: 08/13/09 06:11:00 > -- http://thelaughingstockatpngs.com/ http://www.facebook.com/pages/The-Laughingstock/115923141782?ref=nf From achambers.home at googlemail.com Fri Aug 14 15:12:26 2009 From: achambers.home at googlemail.com (Andy Chambers) Date: Fri, 14 Aug 2009 16:12:26 +0100 Subject: [cells-devel] bug in celtk In-Reply-To: <4A857ABC.8090209@gmail.com> References: <4A856FBA.80109@gmail.com> <4A857ABC.8090209@gmail.com> Message-ID: On Fri, Aug 14, 2009 at 3:54 PM, Kenneth Tilton wrote: > If you now click some place at random do you see "hitting button C"? You > might have to create a checkbox or something else that is enabled and > handles mouse events. No but it does eventually catch up when you close the app down. I added a tcl trace to the "do-on-command" procedure and tcl does indeed seem to be calling that procedure at the correct time. I have a theory that altering defcommand to make it use a command created by TclCreateObjCommand (as opposed to TclCreateCommand) might make it work. I'll send a patch if it does. Cheers, Andy -- ---- Andy Chambers Formedix Ltd From frgo at me.com Fri Aug 14 14:56:23 2009 From: frgo at me.com (Frank Goenninger) Date: Fri, 14 Aug 2009 16:56:23 +0200 Subject: [cells-devel] bug in celtk In-Reply-To: <4A856FBA.80109@gmail.com> References: <4A856FBA.80109@gmail.com> Message-ID: <0E19AC1A-DC92-4B8B-985C-DEB9229DD845@me.com> Hi Kenny, hi Andy, Am 14.08.2009 um 16:07 schrieb Kenneth Tilton: > I do not have that code over here. Maybe FG committed something. I did. But that just extended the number of Mouse Button Down handlers (on-mouse-...). Also I do not see this behaviour in my Celtk copy. I always get on-command fired immediately. > Maybe > if you can describe it better I can figure out what must be going > on. I > am not aware of any problems at the core level, but then again I do > not > have that code so maybe something new is going on. May well be. Do you have a small example, Andy ? Cheers Frank From achambers.home at googlemail.com Fri Aug 14 15:38:07 2009 From: achambers.home at googlemail.com (Andy Chambers) Date: Fri, 14 Aug 2009 16:38:07 +0100 Subject: [cells-devel] bug in celtk In-Reply-To: <0E19AC1A-DC92-4B8B-985C-DEB9229DD845@me.com> References: <4A856FBA.80109@gmail.com> <0E19AC1A-DC92-4B8B-985C-DEB9229DD845@me.com> Message-ID: On Fri, Aug 14, 2009 at 3:56 PM, Frank Goenninger wrote: > Hi Kenny, hi Andy, > > Am 14.08.2009 um 16:07 schrieb Kenneth Tilton: > >> I do not have that code over here. Maybe FG committed something. > > I did. But that just extended the number of Mouse Button Down handlers > (on-mouse-...). Also I do not see this behaviour in my Celtk copy. I always > get on-command fired immediately. What version of tcl/tk are you using? If you're on 8.4, this could confirm my theory. My own copy has diverged somewhat from that in CVS so it's equally likely this is a problem of my own making :-) I sent an example earlier but forgot to CC the list. I'll re-attach it here... (defmd test-buttons (window) (title$ "My Buttons") (kids (c? (the-kids (mk-stack (:packing (c?pack-self)) (mk-stack () (loop for button-id in '(a b c) collect (let ((id button-id)) (mk-button-ex ((symbol-name id) (format t "hitting button: ~a" id))))))))))) If you click "A", then "B", then "C", the console will print... ;;nothing when you click "A" "hitting button: A" ;;when you click "B" "hitting button: B" ;;when you click "C" From achambers.home at googlemail.com Fri Aug 14 15:45:48 2009 From: achambers.home at googlemail.com (Andy Chambers) Date: Fri, 14 Aug 2009 16:45:48 +0100 Subject: [cells-devel] bug in celtk In-Reply-To: <4A8580A5.2090701@gmail.com> References: <4A856FBA.80109@gmail.com> <4A857ABC.8090209@gmail.com> <4A8580A5.2090701@gmail.com> Message-ID: On Fri, Aug 14, 2009 at 4:20 PM, Kenneth Tilton wrote: > That would just leave the problem extant, by finding some other way to > dispatch commands. I may DL and try myself later. Did you grab from CVS > recently? Or, better: zip up your copy and send me that so we are looking at > the same code for sure. Yeah but I think that may be the cause of the problem. Consider this bit from the Tcl docs > Tcl_CreateCommand defines a new command in interp and associates it with procedure proc such that whenever cmdName is invoked as a Tcl command __(via a call to Tcl_Eval)__ the Tcl interpreter will call proc to process the command. vs > Tcl_CreateObjCommand defines a new command in interp and associates it with procedure proc such that whenever name is invoked as a Tcl command (e.g., via a call to Tcl_EvalObjEx) the Tcl interpreter will call proc to process the command. How is Tcl going to know to invoke do-on-command using Tcl_Eval rather than Tcl_EvalObjEx? You can grab a zip of my current working directory at the link below. http://github.com/cddr/celtk/zipball/master Cheers, Andy From frgo at me.com Fri Aug 14 15:50:01 2009 From: frgo at me.com (Frank Goenninger) Date: Fri, 14 Aug 2009 17:50:01 +0200 Subject: [cells-devel] bug in celtk In-Reply-To: References: <4A856FBA.80109@gmail.com> <0E19AC1A-DC92-4B8B-985C-DEB9229DD845@me.com> Message-ID: Am 14.08.2009 um 17:38 schrieb Andy Chambers: > On Fri, Aug 14, 2009 at 3:56 PM, Frank Goenninger wrote: >> Hi Kenny, hi Andy, >> >> Am 14.08.2009 um 16:07 schrieb Kenneth Tilton: >> >>> I do not have that code over here. Maybe FG committed something. >> >> I did. But that just extended the number of Mouse Button Down >> handlers >> (on-mouse-...). Also I do not see this behaviour in my Celtk copy. >> I always >> get on-command fired immediately. > > What version of tcl/tk are you using? If you're on 8.4, this could > confirm my > theory. Mac OS X 10.5.8 with Tcl/Tk 8.5.6 (as downloaded from ActiveState). > My own copy has diverged somewhat from that in CVS so it's equally > likely this > is a problem of my own making :-) > > I sent an example earlier but forgot to CC the list. I'll re-attach > it here... > > (defmd test-buttons (window) > (title$ "My Buttons") > (kids (c? (the-kids > (mk-stack (:packing (c?pack-self)) > (mk-stack () > (loop for button-id in '(a b c) > collect > (let ((id button-id)) > (mk-button-ex ((symbol-name id) (format t > "hitting button: ~a" id))))))))))) > > If you click "A", then "B", then "C", the console will print... > > ;;nothing when you click "A" > "hitting button: A" ;;when you click "B" > "hitting button: B" ;;when you click "C" Using your code above I see the following here: Click on "A" -> 0> defcommand > ^on-command b5 nilhitting button: A This comes before any other button is pressed ... So, again, sorry to say: I can't duplicate it here. Oh - btw - I discovered a "bug" in your on-hover patch: The hover- timer slot in tk.object is defined as ":reader hover-timer" but should be :accessor ... I'm sure you have it ok in your code base... Cheers Frank > _______________________________________________ > cells-devel site list > cells-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/cells-devel -- Frank Goenninger Cell: +49 175 4321058 E-Mail: frgo at me.com From achambers.home at googlemail.com Fri Aug 14 15:56:29 2009 From: achambers.home at googlemail.com (Andy Chambers) Date: Fri, 14 Aug 2009 16:56:29 +0100 Subject: [cells-devel] bug in celtk In-Reply-To: References: <4A856FBA.80109@gmail.com> <0E19AC1A-DC92-4B8B-985C-DEB9229DD845@me.com> Message-ID: On Fri, Aug 14, 2009 at 4:50 PM, Frank Goenninger wrote: > Using your code above I see the following here: > > Click on "A" -> > 0> defcommand > ?^on-command b5 nilhitting button: A OK Thanks for checking that out Frank. I must have something else wrong over here. > This comes before any other button is pressed ... > > So, again, sorry to say: I can't duplicate it here. > > Oh - btw - I discovered a "bug" in your on-hover patch: The hover-timer slot > in tk.object is defined as ":reader hover-timer" but should be :accessor ... > I'm sure you have it ok in your code base... Hadn't come across that as being a problem but it makes sense. Thanks Cheers, Andy From achambers.home at googlemail.com Sat Aug 15 07:40:12 2009 From: achambers.home at googlemail.com (Andy Chambers) Date: Sat, 15 Aug 2009 08:40:12 +0100 Subject: [cells-devel] bug in celtk In-Reply-To: <7DA143FD-3462-47A0-95E6-A8F2BDA1BBD7@consequor.de> References: <4A856FBA.80109@gmail.com> <0E19AC1A-DC92-4B8B-985C-DEB9229DD845@me.com> <7DA143FD-3462-47A0-95E6-A8F2BDA1BBD7@consequor.de> Message-ID: On Fri, Aug 14, 2009 at 5:21 PM, Frank Goenninger - Consequor Consulting AG wrote: > Am 14.08.2009 um 17:56 schrieb Andy Chambers: > >> OK Thanks for checking that out Frank. ?I must have something else >> wrong over here. I think the problem was actually with my Lisp. I changed the test to have the button click reflected in the gui and it happened immediately. My new theory is that because I'm using a single threaded lisp, it doesn't get round to executing the print statement until the next set of events are being processed. If I just just setf the new value into a cell, it all seems to work as expected. -- Andy