where is "answer" defined?
tereza at califex.com
Thu Feb 28 11:02:01 EST 2002
on 02.28.02 09:30 AM, Ben Rubinstein wrote:
> Ah, I was hoping to modify the link between the command and the setting up
> of the dialog data, to persuade it to parse some extra parameters and go to
> a variant version of the stack. Ah well...
If you don't mind using your own version of the commands there's nothing
easier than making your own special ask/answer dialogs.
First, clone the provided stacks, give them your own name, and make them
substacks of your mainstack.
Next, in your mainstack or a library stack script, write a function like:
function MyAnswer pPrompt, pBtn1, pBtn2, pBtn3
function MyAsk pPrompt, pDefault
These functions set up the dialogdata for your dialog, opens your dialog
stack as modal, reads the dialogdata after the stack closes, and returns the
appropriate value. Add whatever parameters you need.
Next, edit the dialog(s) themselves to interpret your dialogdata. I usually
rip out most of the formatting and resizing code, because I know what I
Finally, replace calls to Ask and/or Answer with calls to your function,
ask "whatever" with "something"
if it is "nothing" then --etc
get MyAsk("whatever", "something", the loc of the topstack, myParameter)
if it is "nothing" then....
I routinely do this to make appropriate dialogs for my applications, with
specializations like: adding graphics, formatting fields with the right
fonts, setting the screen location as a parameter, incorporating checkboxes
or pick lists etc. I do the same for the execution error dialog so that it
looks and behaves my way for the end user. That requires a bit of finagling
with the errordialog function, but it's not hard.
. . .. ... ..... ACT AGAINST ENTROPY! ..... ... .. . .
More information about the Use-livecode