Window manager plugin?

J. Landman Gay jacque at hyperactivesw.com
Sat Aug 23 15:39:01 EDT 2014


If I change the "answer" line to this it works:

  answer warning pString with pBtn1 and pBtn2

If you want a more flexible handler that answers with regular, warning, 
or info icons, then you'd need to pass that in a parameter and branch 
the handler depending on the type. I wasn't able to get it to compile 
with this:

  answer pType pString with pBtn1 and pBtn2

so you'd need to do:

on answerWithLoc pType,pString,pBtn1,pBtn2
   set the vis of stack "answer dialog" to false
   switch pType
     case "warning"
       answer warning pString with pBtn1 and pBtn2
       break
     case "info"
       answer info pString with pBtn1 and pBtn2
       break
     default
       answer pString with pBtn1 and pBtn2
   end switch
   set the loc of stack "answer dialog" to the loc of this stack
   set the vis of stack "answer dialog" to true
end answerWithLoc


On 8/23/2014, 1:21 PM, JB wrote:
> Thanks, Jacque.
>
> It is nice to have some more code examples.  I was
> able to get it to work okay but if I use answer warning
> the warning icon does not show.  Is there a way to
> get it to show up with this code?
>
> John Balgenorth
>
>
> On Aug 23, 2014, at 11:06 AM, J. Landman Gay <jacque at hyperactivesw.com> wrote:
>
>> On 8/23/2014, 12:07 PM, Scott Rossi wrote:
>>> I should have clarified that I listed two scripts: one for answer, one for
>>> ask.  But the script is working here for all versions of LC, Mac and Win,
>>> including v7.  Not sure what to tell you.  Did you try the script in a
>>> new, empty stack?
>>>
>>> Something like this would be better to be all-inclusive:
>>>
>>> on suspendStack
>>>     put the openStacks into theList
>>>     if "answer dialog" is among the lines of theList then set the loc of
>>> stack "answer dialog" to loc of me
>>>     if "ask dialog" is among the lines of theList then set the loc of stack
>>> "ask dialog" to loc of me
>>> end suspendStack
>>
>> I needed this once, and tried this suggestion but I couldn't get it to work either. I'm not sure why. I settled on this hack:
>>
>> on answerWithLoc pString,pBtn1,pBtn2
>>   set the vis of stack "answer dialog" to false
>>   answer pString with pBtn1 and pBtn2
>>   set the loc of stack "answer dialog" to the loc of this stack
>>   set the vis of stack "answer dialog" to true
>> end answerWithLoc
>>
>> --
>> Jacqueline Landman Gay         |     jacque at hyperactivesw.com
>> HyperActive Software           |     http://www.hyperactivesw.com
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com




More information about the use-livecode mailing list