I am using a Jupylet app inside of my notebook. If I run app.run() inside of a cell it works fine, but if I trigger the run from an if statement as in my example code, it does nothing. There are no errors, but the app does not show up. How can I solve this?
import sys
import os
sys.path.insert(0, os.path.abspath('./..'))
from jupylet.label import Label
from jupylet.app import App
app = App(width=320, height=64)
hello = Label('hello, world', color='cyan', font_size=32, x=app.width, y=22)
@app.run_me_every(1/24)
def scroll(ct, dt):
hello.x -= dt * 48
if hello.right < 0:
hello.x = app.width
@app.event
def render(ct, dt):
app.window.clear()
hello.draw()
c = 3
if c == 3:
app.run()