Very Basic Modal Dialog Question<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />Standard Dialog Box example:
Names Default To Here( 1 );
If(
ex = Dialog(
Title( " Dialog() example" ),
vlist(
hlist(
"Set this value",
variable = EditNumber( 42 )
),
hlist(
Button( "OK" ),
Button( "Cancel" )
)
)
);
ex["button"] == 1;
,
ex["variable"],
"CANCEL"
);
How do I utilize the secret of the universe number in a table formula following the dialog?
Re: Very Basic Modal Dialog QuestionHere's a version that uses new window instead of the old dialog. The variable x is at your disposal after the dialog exits.
Names Default To Here( 1 );
ex = new window("Dialog() example", << modal(),
vlistbox(
hlistbox(
textbox("Set this value"),
variable_neb = numbereditbox( 42 )
),
hlistbox(
Button box( "OK",
x = variable_neb << get;
),
Button box( "Cancel",
x = .;
)
)
)
);
Re: Very Basic Modal Dialog QuestionI only spent literally a minute but maybe this will help..
If(
ex = Dialog(
Title( " Dialog() example" ),
vlist(
hlist(
"Set this value",
variable = EditNumber( 42 )
),
hlist(
Button( "OK" ),
Button( "Cancel" )
)
)
);
ex["button"] == 1;
,
ex["variable"],
"CANCEL"
);
// I entered 33 versus the default of 42 and added the line at the bottom.
// FYI. DIalog is depracated and New Window is encouraged.
x=ex["variable"];