On Sep 29, 9:11 pm, "Leslie P. Polzer" <[email protected]> wrote: > Sorry I haven't got around to check out your problem here. I'll try to > do so within the next few days.
Thanks for your reply. On Sep 30, 11:05 am, nunb <[email protected]> wrote: > Could you explain what exactly you are trying to do? > > Is it: > > 1. Make a navigation, and have each widget in the navigation capable > of flowing out to another and back. > 2. Have the navigation links themselves start a flow? Neither first nor second. I just want to use the action with continuation after pressing the back button. On Sep 30, 11:44 am, nunb <[email protected]> wrote: > Well, after looking at that code I saw a few things that seemed > wrong. > > 1. If you want to render a link that starts a flow, use lambda/cc to > signal cl-cont to do its job. with-flow macro uses lambda/cc to start a flow. I can rewrite my make- first function this way, but this change nothing: (defun make-first () (let ((w (make-instance 'widget))) (setf (widget-children w) (list (make-widget 1) (lambda () (render-link (lambda/cc (&rest args) (declare (ignore args)) (do-widget w (lambda (k) (declare (ignore k)) (render-widget (make-widget 3))))) "Third")))) w)) > 2. Don't ignore the args in your render-link lambda, that's where the > continuation parameter k gets passed (details not important, unless > I'm totally mistaken!). There is no continuation parameter, because there is no continuation. > This is what I tried: > > 1. Nav with two children 1st and 2nd. > 2. 1st has a link for a with flow, yielding 3rd. > > Results: > > Flowing from 1st to 3rd works. Going to 2nd and using back button > brings one back to the 1st widget (whether in a state of having flowed > out to 3, or pre-flow). > > The code is below... What your code do is not what I want. You replace not the first widget but the children of the first widget. Try this and you will see my problem: (defun make-first () (let ((w (make-instance 'composite))) (setf (composite-widgets w) (list (make-widget 1) (make-instance 'simple-widget :render-fn (f_ (with-html (render-link (lambda/cc (&rest args) (with-flow w ; I have changed underscore with w (yield (make-answering-widget 3)))) "Third")))))) w)) On Sep 30, 1:02 pm, nunb <[email protected]> wrote: > screencast:http://www.youtube.com/watch?v=zQkxxUcHzxg By the way, the screencast is not available. I think that after pressing back button and calling the action the first widget cannot be found in the navigation. This widget has become invalid since the closure was created. Am I right? I wrapped first widget in another widget. This code works: (defun make-first () (let ((w (make-instance 'widget))) (setf (widget-children w) (list (make-widget 1) (lambda () (render-link (lambda (&rest args) (declare (ignore args)) (with-flow w (yield (make-widget 3)))) "Third")))) (make-instance 'widget :children (list w)))) Thanks, Tim --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "weblocks" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/weblocks?hl=en -~----------~----~----~----~------~----~------~--~---
