Re: Initial menu
- Posted by Dan Moyer <DANIELMOYER at prodigy.net> Mar 01, 2003
- 465 views
Pete, I made the following mod of a Win32Lib demo called "splash.exw"; it orginally presented a "splash" screen, with a bitmap, waited a while, then disappeared & opened the main window. The mod below shows an initial window with text & some buttons, one button quits, the other two open two different windows, one of which is the "main" window, and destroy the initial menu window. Is this anything like what you were wanting? (Even if it is, there may be better ways to do it, probably.) Dan Moyer PS. I second Kats remark about your signature. -- <code begins> --------INITIAL MENU WINDOW EXAMPLE --------- include win32lib.ew without warning constant -- Create a main window with no dimensions and out of view Main = create( Window, "Main", 0, 0, -100, 0, 0, 0 ), -- make a 2nd window: secondW = create(Window, "second window", Main,0,0,200,200,0), -- Create a window for the initial menus: Splash = create(Window, "Splash",0, 100, 100, 200, 230, {WS_POPUP, WS_BORDER, WS_VISIBLE}), -- with information: L1 = create(CText, "click on a button", Splash, 5, 10, 150, 50, 0), -- and some buttons to open windows or exit: b1 = create(Button, "One", Splash, 5, 150, 50, 50, 0), b2 = create(Button, "two", Splash, 65, 150, 50, 50, 0), b3 = create(Button, "exit", Splash, 130, 150, 50, 50, 0) integer btn1, btn2 -- show/goto the main window: procedure openMainWindow() -- Show the main window now. setRect(Main, 0, 0, 170, 350, 1) destroy(b1) destroy(b2) destroy(b3) destroy(Splash) end procedure onClick[b1] = routine_id("openMainWindow") procedure open2nd() destroy(b1) destroy(b2) destroy(b3) destroy(Splash) openWindow(secondW , Normal) end procedure onClick[b2] = routine_id("open2nd") procedure quit() destroy(b1) destroy(b2) destroy(b3) destroy(Splash) close(Main) destroy(Main) end procedure onClick[b3] = routine_id("quit") procedure initialize() -- Begin initialising the main window's stuff. btn1 = create(Button, "One", Main, 5, 5, 50, 50, 0) btn2 = create(Button, "Two", Main, 5, 65, 50, 50, 0) end procedure onActivate[Main] = routine_id("initialize") procedure onClose2nd() destroy(Main) end procedure onClose[secondW] = routine_id("onClose2nd") WinMain( Main, Normal ) ----- Original Message ----- From: "Pete Lomax" <petelomax at blueyonder.co.uk> To: "EUforum" <EUforum at topica.com> Sent: Thursday, February 27, 2003 6:45 PM Subject: Initial menu As I understand things, you cannot call WinMain twice in the same program. Guess I need a dummy (invisible) window then, a popmenu selection, and _then_ create/display the appropriate window... Is there an example of this anywhere? Pete Confucius say: Life sucks. Get over it. You fairy. ==^^=============================================================== This email was sent to: DANIELMOYER at prodigy.net TOPICA - Start your own email discussion group. FREE!