• Hi folks,

    the forum is now set to read only.

    After 6 yrs under my control, I have done all the work on April 6th that was needed to be able to transfer the database, forum files and the domain to Philipp Moeller aka @Phil7. The Github repository was already transfered and under his control.

    According to GDPR/DSGVO laws, all user accounts are now deleted that didn't accept the new terms (Updated on March 7th 2024 and an email was send to your address).

    I wish you all a great future and health. As the internet is gigantic but sometimes also very small, I am sure we will bump into each other someday again. Looking forward to it. :-)

    Cheers
    Michael

  • Hi folks,
    as per verbal aggreement between the new owner of the Cerberus X community and myself, I will keep this place online till May 6th, 2024.
    After that date it will be purged and this Domain will be most likely be used for my own stuff again.
    I am not participating in the new place for various reasons.
    If someone wants to contact me you can do so via mail to mike@fantomgl.com.
    Best wishes
    Michael

How to let the app active all the time

mag

Active member
3rd Party Module Dev
3rd Party Tool Dev
Joined
Mar 5, 2018
Messages
261
When my window desktop app loses focus, both rendering and updating come to a halt. This also happen in the HTML build and likely other builds as well.

While this behavior may be acceptable on mobile platforms where typically only one task is displayed at a time, it becomes inconvenient on desktop. Specifically, I want my app, which functions as a clock, to continue rendering even when I'm focused on another application.

Any suggestions on how to address this would be greatly appreciated!

Code:
Import mojo
Class MyApp Extends App
    Field x:Float
    Field y
    Method OnCreate()
        SetUpdateRate 60
        Seed=Millisecs()
        y=Rnd(100)
    End
    Method OnUpdate()
        x=x+0.5
     End
    Method OnRender()
        Cls 128,0,255
        DrawRect 10,10,100,100
        DrawText "Hello World!",x,y
    End
    Method OnSuspend()
        Print "OnSuspend"
    End
    Method OnResume()
        Print "OnResume"
    End
End
Function Main()
    New MyApp   
End
 
Add the preprocessor directive/variable to the code.
#MOJO_AUTO_SUSPEND_ENABLED=False

Cerberus:
Import mojo

#MOJO_AUTO_SUSPEND_ENABLED=False

Class MyApp Extends App
    Field x:Float
    Field y
    Method OnCreate()
        SetUpdateRate 60
        Seed=Millisecs()
        y=Rnd(100)
    End
    Method OnUpdate()
        x=x+0.5
     End
    Method OnRender()
        Cls 128,0,255
        DrawRect 10,10,100,100
        DrawText "Hello World!",x,y
    End
   
    Method OnSuspend()
        Print "OnSuspend"
    End
   
    Method OnResume()
        Print "OnResume"
    End
End
Function Main()
    New MyApp  
End
 
Last edited:
  • Love
Reactions: mag
They are under the App Config Settings. These are the predefined target specific preprocessor variables.

@Phil7: The Programming Language Reference documentation should really be updated to include a link to the App Config Settings documentation in the Preprocessor section.
Some thing like:
Target Specific Directives
Cerberus also has built in target specific directives to control the build configuration and output for each of the supported target.
See App Config Settings.
 
Last edited:
Back
Top Bottom