Looks like a simple error: the Text Edit Box isn't assigned to the variable teb. Try this:
Names Default to Here( 1 );
ex = New Window( "",
<< modal,
Border Box( "", teb = Text Edit Box("", << Set Width( 500 ) ) ),
Panel Box( "", H List Box( Button Box( "OK", ng = teb << get text ) ) )
);
Ross Metusalem
JMP Academic Ambassador