base:CloseDisplay()

You can post your code snippets here for others to use and learn from
Post Reply
djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

base:CloseDisplay()

Post by djrikki » Wed Apr 15, 2015 11:16 pm

I use this all the time instead of using the internal CloseDisplay() function.

This will return whether or not the when has been closed successfully.

Code: Select all

Global base
base = {}

Function base:CloseDisplay(window)
    ExitOnError(False)
    If GetAttribute(#DISPLAY, window, #ATTRSTATE) = #DISPSTATE_OPEN
	    Local err
		
	    If GetAttribute(#DISPLAY,window,#ATTRSTATE) <> #DISPSTATE_CLOSED
	        Err = False
	        CloseDisplay(window)
	    Else
	        Err = True
	    EndIf
    EndIf
    ExitOnError(True)
    
    Return (err)
EndFunction
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com

Post Reply