Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!
...
The prompt can be either formatted text (in the property's format) or plain text. If the prompt contains <p> or a start/end tag pair, the answer command assumes the text is in the same format as the property. Otherwise, the answer command assumes the text is plain text.
...
But since LC supports a small subset of html I simply tried this with an image.
Et voila, it works!
dunbarx wrote: Fri May 10, 2024 4:39 pm
HOW COULD THEY NOT mention this somewhere? It would be a fabulous addition to who knows how many LC gadgets.
Craig
I'm guessing that by the time you've made the image the right size, positioned everything as you want and then have to keep doing this for every image, you're probably better off designing a substack of your own. And it would probably look a whole lot better since you'd control the layout directly...
Or to put it differently - why is this better than a substack presented as modal?
The coding would be trivial and you wouldn't be constrained by the limits of the answer dialog...
<p>Do you like this band?</p>
<p><img src="band"></p>
See the second line, which refers to the image on the current card named "band"
and this is the html tag which does the magic: <img src="band">
I was also very surprised that this actually works.
On the other hand, <img src... is a VERY basic html tag.
On OS X systems, the image specified in the gRevAppIcon variable appears as the application icon in the answer dialog box (unless the answer...as sheet form is used). If you specify an iconType, the image specified in the gRevSmallAppIcon variable is used instead, along with the special icon specified by the iconType.
I got as far as "On OS X systems, the image specified in the..."
Could not agree more. But where else might it be possible to insert an image where before I (we?) only assumed text could go?
I still have not heard from Klaus on what might be a single line of code that placed that image into the dialog.
Craig
I know what you mean, but in my mind just because you can doesn’t mean you should
I have certainly used basic html in answer dialogs for styling… I’ll admit it never occurred to me to add an image tag, because that would be highly atypical for such a dialog, so I never felt the need to test it.
If I need to present an image dialog with custom image(s) to the user I’ll just substack it so I have full layout control.
Perhaps Richmond can elaborate on the point of this?
Richmond had drunk 4 glasses of strong red wine and his mind was wandering.
However, the 'problem' about using a substack as an answer palette is that it can get obscured by other substacks unless one is very careful.
In my Devawriter I use images in the main stack and set the visible when they are needed: the snag about this is that one needs one of these images on every card where you might want them displayed.
Certainly:
1. An Answer/Ask palette without an IDE logo is, as far as I'm concerned a big plus.
2. An Answer/Ask palette with a bespoke logo is, as far as I'm concerned a big plus.
3. The logical extension of #2 is an image or a set of images.
Klaus's solution is, like the vast majority of Klaus's solutions, really marvellous.