Re: return value from dialog window

new topic     » goto parent     » topic index » view thread      » older message » newer message

Horvath Stefan wrote:
> 
> Hi all,
> It is possibly to have a Dialog which return a value (integer, exemple) in
> correspondence with PushButtons clicked in Window.

You could create a function which wraps a openWindow() call like this:


sequence dlgResult

-- build an input dialog
constant win_Main = createEx( Window, "YesNo Dialog", 0, Default, Default, 192,
120, 0, 0 )
constant LText2 = createEx( LText, "What's your answer?", win_Main, 40, 16, 116,
20, 0, 0 )
constant bttn_Yes = createEx( PushButton, "Yes", win_Main, 40, 48, 52, 24, 0, 0
)
constant bttn_No = createEx( PushButton, "No", win_Main, 100, 48, 52, 24, 0, 0 )

-- create functions to set variable result
-- i.e., for bttn_Yes_OnClick, setResult="Yes"
-- i.e., for bttn_No_OnClick, setResult="No"

function runDialog( sequence win )
    openWindow(win,Normal)
    return dlgResult
end function

Then

    result = runDialog( win_input )

But I bet there's an easier way. ;)

-=ck
"Programming in a state of EUPHORIA."
http://www.cklester.com/euphoria/

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu