Hi Kashyap,

> Removing the quote does get rid of the error message but I'm not sure
> how to access the uploaded content though. I noticed that even app/item.l
> has a quote before the cond expression.

Ah, sorry! I misread your mail. I saw

   '(if ...
      '(cond

So I thought '(if ...) is the button action, and thus the cond expression quoted
again :)


So yes, (cond ..) is the button action, also in the code in app/item.l:

   (gui '(+Drop +Button) '(field -1)
      '(if (: home obj jpg) ,"Uninstall" ,"Install")
      '(cond
         ((: home obj jpg)
            (ask ,"Uninstall Picture?"
               (put!> (: home top 1 obj) 'jpg NIL) ) )
         ((: drop) (blob! (: home obj) 'jpg @)) ) )

This button changes both title and behavior, depending on whether (: home obj)
already has a 'jpg' prooperty or not.

*If* (: home obj jpg) is there, it uninstalls the image.

Otherwise, if something was dropped on the button, the path is in the (: drop)
property, and stored as a blob in the item.


You could try to debug it. Put a breakpoint

   ((: drop) (! blob! (: home obj) 'jpg @))

Then put an image into the upload field and press the button (or drag/drop an
image onto the button if your desktop and browser support it).

It will stop at the breakpoint

   (blob! ...

Then look at

   ! (: drop)

As ever, you need to start in debug mode (recommeded anyway) with a '+' at the
end of your command line.

☺/ A!ex


-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to