Win32lib focus problem-oh!
- Posted by George Henry <ghenryca at HOTMAIL.COM> Dec 05, 2000
- 418 views
-- focus.exw include \euphoria\userlib\win32lib.50\win32lib.ew constant winUno = create(Window, "Uno", 0, Default, Default, 200, 100, 0), btnUno = create(PushButton, "winDos", winUno, 10, 10, 50, 20, 0), winDos = create(Window, "Dos", winUno, Default, Default, 200, 100, 0), btnOK = create(PushButton, "OK", winDos, 10, 10, 50, 20, 0), btnCancel = create(PushButton, "Cancel", winDos, 70, 10, 50, 20, 0) procedure onClick_btnUno() openWindow(winDos, Modal) end procedure procedure onClick_btnOK() integer response response = message_box("Are you sure it's OK?", "Please confirm", MB_YESNOCANCEL) if response = IDYES then closeWindow(winDos) end if end procedure procedure onClick_btnCancel() closeWindow(winDos) end procedure onClick[btnUno] = routine_id("onClick_btnUno") onClick[btnOK] = routine_id("onClick_btnOK") onClick[btnCancel] = routine_id("onClick_btnCancel") WinMain(winUno, Normal) [end code] I posted a question about this yesterday, and no one has repsonded, so I thought I would make it easier to see what I'm talking about, and at the same time, by writing the simplest possible program to demonstrate it, determine whether something extraneous in my code was causing the problem. The code above does exactly what my code does, that I am concerned about. While running some other program (such as, hmm, your Web browser, for example), maximize that program. Then run the above program. Click on the "winDos" button, then click on the "OK" button. click on "Yes" in the message box. What happens? Is it what you would want to happen??? Now find winUno and click on the "winDos" button, then click on the "Cancel" button. How does the program behave differently this time? Finally, click on "winDos", then on "OK", click on "No" or "Cancel" in the message box, then click on "Cancel". NOW what happens? Why does invoking the message box from winDos cause the entire application to be shoved into the background when winDos is closed? And how can I prevent this from happening? I consider this a very serious (i.e. totally unacceptable) user interface flaw with my program. Please and thank you, George _____________________________________________________________________________________ Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com