1. win32lib - a question asked before
- Posted by Reverend Ferlin <ferlin at SANDW.NET> Nov 04, 1998
- 406 views
All, I remember this question being asked before, but I figured I could get an answer quicker from the list than trying to look through the archives. The problem I am having is this, I am attempting to write a program using win32lib, I am using GENERIC.EXW as a template to start with, I added a menu choice that when chosen it opens another window, all seems to work fine, but if I click the X button in the new window, rather than returning to the Basic Window, it completely exits the application. I need it to return to the Basic Window, so I can choose another window from the menu, any help would be appreciated. Thanks In Advance (TIA), Later, + + + Rev. Ferlin Scarborough - Centreville, Alabama - USA
2. win32lib - a question asked before
- Posted by Ad Rienks <Ad_Rienks at COMPUSERVE.COM> Nov 04, 1998
- 418 views
Look at the demo I wrote. This one works on my computer. Most of the answers I give you, are given before by Michael Sabal. You can find the thread in the archives under "jury-rigged dialogs". (Really don't know wh= at is meant by that ). Some points: - Open the secundary window with no 'parent' (3rd parameter =3D 0), and a= s a WS_DIALOGFRAME. That way the X is disabled. - When you open Window2, disable the Main window by setEnable(Main, 0). - Closing should only be done by the window's one Close button method. Th= is should enable the Main window again. You should not use unloadWindow(Window2), as this unloads the whole application. I use setVisible(Window2, 0) to hide the second window, but closeWindow(Window2= ) is also possible. The window is then minimized and disappears somewhere into the status bar. Any comments? ---------- Start of secndwin.exw ---------- -- demo of secundary window include Win32Lib.ew constant Main =3D create(Window, "Main window", 0, Default, Default, 640, 480,= 0), MenuWin =3D create(Menu, "Windows", Main, 0, 0, 0, 0, 0), MenuSecond =3D create(MenuItem, "Window 2", MenuWin, 0, 0, 0, 0, 0), Window2 =3D create(Window, "Window 2", 0, Default, Default, 320, 240,= WS_DLGFRAME), btnClose =3D create(PushButton, "Close", Window2, 130, 120, 60, 25, 0= ) global procedure onMenu_MenuSecond() loadWindow(Window2) setEnable(Main, 0) end procedure onMenu[MenuSecond] =3D routine_id("onMenu_MenuSecond") global procedure onClick_btnClose(integer mouseX, integer mouseY) setVisible(Window2, 0) setEnable(Main, 1) end procedure onClick[btnClose] =3D routine_id("onClick_btnClose") WinMain(Main) ---------- End of secndwin.exw ---------- >All, > I remember this question being asked before, but I figured I cou= ld get >an answer quicker from the list than trying to look through the >archives. The problem I am having is this, I am attempting to write a >program using win32lib, I am using GENERIC.EXW as a template to start >with, I added a menu choice that when chosen it opens another window, >all seems to work fine, but if I click the X button in the new window, >rather than returning to the Basic Window, it completely exits the >application. I need it to return to the Basic Window, so I can choose >another window from the menu, any help would be appreciated. >Thanks In Advance (TIA), >Later, >+ + + Rev. Ferlin Scarborough - Centreville, Alabama - USA
3. Re: win32lib - a question asked before
- Posted by Reverend Ferlin <ferlin at SANDW.NET> Nov 04, 1998
- 407 views
Ad Rienks wrote: > > Some points: > - Open the secundary window with no 'parent' (3rd parameter = 0), and as a > WS_DIALOGFRAME. That way the X is disabled. > - When you open Window2, disable the Main window by setEnable(Main, 0). > - Closing should only be done by the window's one Close button method. This > should enable the Main window again. You should not use > unloadWindow(Window2), as this unloads the whole application. I use > setVisible(Window2, 0) to hide the second window, but closeWindow(Window2) > is also possible. The window is then minimized and disappears somewhere > into the status bar. Ad, Thanks the above worked with the exception that in my program I had to add setFocus(Main) otherwise it would show the Main Window, but it would be grayed out. Thanks for the pointer and thanks to Michael Sabal, who by the way has a very nice web site. Later, + + + Rev. Ferlin Scarborough - Centreville, Alabama - USA
4. Re: win32lib - a question asked before
- Posted by Ad Rienks <Ad_Rienks at COMPUSERVE.COM> Nov 04, 1998
- 391 views
- Last edited Nov 05, 1998
Ferlin wrote: >Thanks the above worked with the exception that in my program I had to >add setFocus(Main) otherwise it would show the Main Window, but it would= >be grayed out. That's a good point you're making. I hadn't thought of that. However, with the Main Window grayed but enabled, you can also give it focus again just by clicking in it, isn't it? Happy coding, Ad