Custom Modal List Dialog Methodology

Stephen Barncard stephenREVOLUTION at barncard.com
Sat Jun 25 13:58:51 EDT 2005


I'm currently recreating in REV what I used to use a Rinaldi XCMD 
for... namely a listbox dialog for choosing items from a list.

The idea is to have a function


function listbox pPromptData,pListData

that puts up a window with a prompt field, and a list field. Select 
and click an item or hit return or enter. Standard GUI stuff.

This would return the selected item or empty.


I've created the new window/stack, I'm using dialogData to pass the 
info back and forth, and I have the function that sets up the data 
and opens the window. I had figured on using wait with messages to 
halt script execution until the dialog was closed, but I can't seem 
to send the right message to it from the dialog closing to get it to 
go to the next line of code, 'BEEP'. I also tried changing a 
variable. Anyone found the best way to deal with this?

Eventually I'd like to be able do it all from a script on the fly - 
create the window,fields, buttons, everything, from a text 
description before display like I used to do in WindowScript... it's 
all about properties, after all....

thanks...

--this is located in the stack script of the calling stack
--scrunch converts returns to VTs to get more data in dialogdata

function dialogList pPrompt,pListData
   global gDialogFlag
   if there is a stack "listDialog"
   then
     put scrunch(pPrompt) & return & scrunch(pListData) into tDialogTxt
     set the dialogData to tDialogTxt
     --- put the dialogData
     -- exit to top
     put "true" into gDialogFlag
     open stack "listDialog"   <------ this is the dialog
     wait with messages
     -- wait until gDialogFlag is "false" with messages??
     beep        <--------this never executes
    
   else
     answer "Can't find stack: listDialog"
     exit to top
   end if
   return the dialogData
end dialogList



More information about the use-livecode mailing list