base:SafeSleep()

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:SafeSleep()

Post by djrikki »

Here is one that deals with MUI Royale and a Window's 'Sleep' property. Avoid stacking 'sleep'.

Code: Select all

Global base
base = {}

; Because Sleep is a strangely stackable class property of a window most of the time you will want to prevent this from happening, this function stops this from ever happening.
Function base:SafeSleep(window,state)
    If mui.Get(window,"sleep") = Not(state)
        mui.Set(window,"sleep",state)
    EndIf
EndFunction
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
Post Reply