Hiding a windowed screen
Posted: Wed May 19, 2004 3:37 pm
Hello,
Does anyone know how to hide a windowed screen? I need something like the HideGadget() command, but haven't been able to figure it out or find anything on the forums about this.
This is as far as I have got so far, although the problem is that ScreenID() returns the same value as WindowID(). Any suggestions would be most welcome.
Thanks.
Does anyone know how to hide a windowed screen? I need something like the HideGadget() command, but haven't been able to figure it out or find anything on the forums about this.
This is as far as I have got so far, although the problem is that ScreenID() returns the same value as WindowID(). Any suggestions would be most welcome.
Thanks.
Code: Select all
If InitSprite()=0 : End : EndIf
If OpenWindow(0, 0, 0, 400, 350, #PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget|#PB_Window_SizeGadget|#PB_Window_TitleBar, "")
If CreateGadgetList(WindowID())
ButtonGadget(1, 10, 310, 380, 30, "Show/hide")
EndIf
If OpenWindowedScreen(WindowID(), 0, 0, 400, 300, 0, 0, 50)
wid.l = WindowID()
Debug wid
sid.l = ScreenID()
Debug sid
SetFrameRate(60)
StartDrawing(ScreenOutput())
gtc.l = GetTickCount_()
RandomSeed(gtc)
For i.l=1 To 100000
Plot(Random(399), Random(299), RGB(Random(255),Random(255),Random(255)))
Next
StopDrawing()
EndIf
Repeat
ev = WaitWindowEvent()
While ev
Select ev
Case #PB_Event_Gadget
show_hide = 1 - show_hide
If show_hide
; hide
ShowWindow_(sid, SW_HIDE)
Else
; show
ShowWindow_(sid, SW_SHOW)
EndIf
Case #PB_Event_Repaint
FlipBuffers()
FlipBuffers()
Case #PB_Event_CloseWindow
quit = 1
EndSelect
ev = WindowEvent()
Wend
Until quit=1
EndIf
End