Re: How can I make a field ready to receive typing?
- Posted by Louis at cwshop.com Oct 09, 2003
- 415 views
OK Derek, thanks for your help. Your example does work, BUT... What I am trying to do is open a window at the beginning of the program to= check for a password, and if entered correctly, then close the password= window and open the main window. I find the initial window is considered= the "main" window and I cannot close it without killing off the entire= windowing system. Therefore, I open a secondary window to prompt for the= password, but when I do this I must click on the field or tab to it before= typing is possible. Here is my version of your program: Louis. without warning include win32lib.ew integer MainWin, Win2 integer Text1 integer Text2 integer Text3 integer Text21 integer Text22 integer Text23 MainWin =3D create(Window, "Initial Focus",0, 0, 0, 300, 300, 0) Text1 =3D create(EditText, "Not here", MainWin, 5, 5, 200, 25, 0) Text2 =3D create(EditText, "This is it", MainWin, 5, 35, 200, 25, 0) Text3 =3D create(EditText, "Nor here", MainWin, 5, 65, 200, 25, 0) Win2 =3D create(Window, "Window 2", MainWin, 50, 50, 300, 300, 0) Text21 =3D create(EditText, "Password", Win2, 5, 5, 200, 25, 0) Text22 =3D create(EditText, "Text22", Win2, 5, 35, 200, 25, 0) Text23 =3D create(EditText, "Text23", Win2, 5, 65, 200, 25, 0) procedure Open_Win2(integer self, integer event, sequence parms) openDialog(Win2) setFocus(Text21) -- This doesn't do anything end procedure setHandler(MainWin, w32HActivate, routine_id("Open_Win2")) WinMain(MainWin, Normal)