Re: Win32lib question
- Posted by Dan Moyer <DANIELMOYER at prodigy.net> Mar 24, 2002
- 511 views
Dan, Welcome. As far as I know, you're right, to make multiple windows, make each after the first a child of it (or any others, I think). If you haven't already, check out Judith's IDE, it's a big help in easily making Windows programs. Might also try my "RunDemos", it's helpful to easily see & make use of the various demos/examples for Win32Lib. Here's an example of what Judith's IDE did for making some windows (it made each window a child of the just previously created one, though on the version of the IDE I used, it said (within the IDE) that they were all children of the first window; myself, I don't know what difference any specific window parenting would make, but you can make them however you want. I put the "moveZOrder" command in so that when you opened a sequence of windows, and then closed them, the main would not get minimized. Dan Moyer -- multiple windows demo -- code generated by Win32Lib IDE v0.10.4 include Win32lib.ew without warning ---- -- Window Window1 global constant Window1 = create( Window, "Window1", 0, Default, Default, 400, 300, 0 ) global constant PushButton7 = create( PushButton, "Open Window 2", Window1, 20, 20, 90, 30, 0 ) global constant PushButton8 = create( PushButton, "Open Window 3", Window1, 128, 20, 90, 30, 0 ) global constant PushButton9 = create( PushButton, "Open Window 4", Window1, 244, 20, 90, 30, 0 ) ---- -- Window Window2 global constant Window2 = create( Window, "Window 2", Window1, Default, Default, 400, 300, 0 ) global constant PushButton10 = create( PushButton, "Open Window 5", Window2, 52, 40, 90, 30, 0 ) ---- -- Window Window3 global constant Window3 = create( Window, "Window 3", Window2, Default, Default, 400, 300, 0 ) global constant PushButton11 = create( PushButton, "Open Window 6", Window3, 60, 40, 90, 30, 0 ) ---- -- Window Window4 global constant Window4 = create( Window, "Window 4", Window3, Default, Default, 400, 300, 0 ) global constant PushButton13 = create( PushButton, "Open Window 7", Window4, 76, 36, 90, 30, 0 ) ---- -- Window Window5 global constant Window5 = create( Window, "Window 5", Window4, Default, Default, 400, 300, 0 ) ---- -- Window Window6 global constant Window6 = create( Window, "Window 6", Window5, Default, Default, 400, 300, 0 ) ---- -- Window Window7 global constant Window7 = create( Window, "Window 7", Window6, Default, Default, 400, 300, 0 ) ---- procedure Window1_onClick () openWindow( Window5, Modal ) end procedure onClick[Window1] = routine_id("Window1_onClick") ---- procedure PushButton7_onClick () openWindow( Window2, Modal ) end procedure onClick[PushButton7] = routine_id("PushButton7_onClick") ---- procedure PushButton8_onClick () openWindow( Window3, Modal ) end procedure onClick[PushButton8] = routine_id("PushButton8_onClick") ---- procedure PushButton9_onClick () openWindow( Window4, Modal ) end procedure onClick[PushButton9] = routine_id("PushButton9_onClick") ---- procedure Window2_onClose () moveZOrder( Window1, HWND_TOP) end procedure onClose[Window2] = routine_id("Window2_onClose") ---- procedure PushButton10_onClick () openWindow( Window5, Modal ) end procedure onClick[PushButton10] = routine_id("PushButton10_onClick") ---- procedure Window3_onClose () moveZOrder( Window1, HWND_TOP) end procedure onClose[Window3] = routine_id("Window3_onClose") ---- procedure PushButton11_onClick () openWindow( Window6, Modal ) end procedure onClick[PushButton11] = routine_id("PushButton11_onClick") ---- procedure Window4_onClose () moveZOrder( Window1, HWND_TOP) end procedure onClose[Window4] = routine_id("Window4_onClose") ---- procedure PushButton13_onClick () openWindow( Window7, Modal ) end procedure onClick[PushButton13] = routine_id("PushButton13_onClick") WinMain( Window1, Normal ) ----- Original Message ----- From: <dmccu at connect.ab.ca> To: "EUforum" <EUforum at topica.com> Sent: Sunday, March 24, 2002 8:56 PM Subject: Win32lib question > > Hi everyone, > > As a new registered user of Euphoria I am finding the language pretty > much perfect for my needs, and the quick and helpful support from > Robert Craig and this board is something that I am very happy with. I > wonder though about Win32 development, is Win32lib being worked on or > what is the story? I notice the date of March 5/01 as the last update > on the archives. I am not getting on anyone here, I am just wondering > about this, as Euphoria is the perfect language to have a good solid > Win32 development tool with it, and one that is updated on a regular > basis. If this topic has already been discussed I apologize, I tried to > search this list but had no luck. I hope I have not stepped on any toes > here. > > Now for my newbie windows question, How do you have multiple windows in > Win32lib? You only have one Winmain statement but I need to go from one > window to the next. Do I have to make child windows of the main window > all the time? > > Thanks, > Dan > > P.S. put me in the pro-Goto group, I am sure I could write neater > better code without the dreaded Goto but as a hack hobbyist programmer I > am happy to just make it work and if I'm comfortable with so-called > spaghetti code and I get the job done I don't care if it isn't the most > structurally perfect or neatest, it is how I like to program. >