Page 1 of 1

Posted: Tue Sep 18, 2001 10:33 am
by BackupUser
Restored from previous forum. Originally posted by PB.

Hi,

My app has two open windows that are like so:

If OpenWindow(0, ...
If OpenWindow(1, ...

My problem is: How do I close window number 1? If I click on the "X" at
the top-right, BOTH windows close. Even using "closewindow(1)" makes
both windows close instead of just window number 1...

Posted: Tue Sep 18, 2001 1:56 pm
by BackupUser
Restored from previous forum. Originally posted by Mr.Skunk.

Here is a way to do that.

Code: Select all

 OpenWindow(0, 100, 100, 200,200, #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget, "Window 1")
OpenWindow(1, 300, 300, 200,200, #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget, "Window 2")

openedwindows=2

Repeat
ev.l=WaitWindowEvent()
  If ev.l=#PB_EventCloseWindow
    openedwindows-1
    CloseWindow(EventWindowID())
  EndIf
Until openedwindows=0
End
Hope it helps...


Mr Skunk

Mr Skunk's PureBasic Web Page
http://www.skunknet.fr.st

Edited by - mr.skunk on 18 September 2001 15:10:52