ask dialog cursor

Frank D. Engel, Jr. fde101 at fjrhome.net
Wed Oct 6 08:36:29 EDT 2004


On Oct 6, 2004, at 1:22 AM, Andrew wrote:

> Hi, Frank.  Thanks for your response!
>>
>> In other words, since the stack is part of the IDE, modifying it will
>> affect the entire IDE and any stack opened within the IDE which
>> utilizes the resources of that stack.
> Great, so what code should I put in my preopenstack handler to tinker 
> with the IDE ask stack?  (To make the cursor appear after the entered 
> key in the ask dialog)

You can see the IDE's stacks in Application Browser after setting a 
preference to do so (Under 2.5, this is on the General page of 
preferences and is labelled "Revolution UI elements appear in lists of 
stacks").

However, personally, I recommend the other approach (below).

>>>
>>> Is there an easier way to solve this problem without tinkering with
>>> external stacks?  Can i just make all the changes within my stack?
>>
>> Sure.  Make your own custom "ask" dialog box and use it instead of the
>> one provided by Rev.
> Great!  how do I do that?

Create a new substack, with a field for your input and whatever buttons 
you wish to appear, perhaps "OK" and "Cancel".

stack "My Ask Dialog":

on preOpenStack
   -- do whatever you need to do to fill in the field with the starting 
value from your program
   select after field "My Ask Field"
end preOpenStack


button "OK" of stack "My Ask Dialog":

on mouseUp
   -- do whatever you need to do to send the value back to your program
   put "OK" into it
end mouseUp


button "Cancel" of stack "My Ask Dialog":

on mouseUp
   put "Cancel" into it
end mouseUp



Now to open the dialog, use one of these two commands:

modal "My Ask Dialog"    -- will always open the dialog as a modal 
dialog

sheet "My Ask Dialog"     -- will open the dialog as a sheet under OS X 
(if no other sheet open), else
                                              -- will open as a modal 
dialog, as with the "modal" comma nd

Note that with 2.2.1 there was a bug which could cause Rev to crash 
when using the sheet command when a sheet was already opened; this 
seems to be fixed in 2.5, however.


None of this is difficult.


>
> Thanks!
> Andrew
-----------------------------------------------------------
Frank D. Engel, Jr.  <fde101 at fjrhome.net>

$ ln -s /usr/share/kjvbible /usr/manual
$ true | cat /usr/manual | grep "John 3:16"
John 3:16 For God so loved the world, that he gave his only begotten 
Son, that whosoever believeth in him should not perish, but have 
everlasting life.
$



___________________________________________________________
$0 Web Hosting with up to 120MB web space, 1000 MB Transfer
10 Personalized POP and Web E-mail Accounts, and much more.
Signup at www.doteasy.com



More information about the use-livecode mailing list