Re: How to hide & close main win on open (win32lib)

new topic     » goto parent     » topic index » view thread      » older message » newer message

xEmul wrote:
> 
> Hello!
> 
> I need help!
> I have 2 windows: win1 and win2
> win1 used by WinMain
> How I can do following:
> 1. on open win1 show modal win2, but don't show win1
> 2. on close win2 close app without showing win1
> 
> (1) may be realised by openDialog. But if I close win2 - win1 is appear and
> don't close
> if I use openWindow(win2, Modal) - win1 is appear immediately,
> but on close win2 correct work closeApp
> 
> It may be the same as showing password dialog
> and closing app by hiting Cancel button on it
> 

I think this does what you're asking for:
include win32lib.ew

constant
win1 = create( Window, "Win1", 0, Default, Default, Default, Default, 0 ),
openwin2 = create( PushButton, "Open Window", win1, 10, 10, 90, 30, 0 ),
win2 = create( Window, "Win2", win1, Default, Default, Default, Default, 0 )

procedure click_open( integer self, integer event, sequence params )
	showWindow( win1, SW_HIDE )
	openDialog( win2 )
	showWindow( win1, SW_NORMAL )
end procedure
setHandler( openwin2, w32HClick, routine_id("click_open") )

WinMain( win1, Normal )


Matt Lewis

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu