def buildAppEntry(a):
    cont = pyos.GUI.Container((0, 0), color=state.getColorPalette().getColor('background'), width=(app.ui.width - 2), height=40)
    ic = a.getIcon()
    icon = None
    if (ic != False):
        icon = pyos.GUI.Image((0, 0), surface=a.getIcon())
    else:
        icon = pyos.GUI.Image((0, 0), surface=state.getIcons().getLoadedIcon('unknown'))
    title = pyos.GUI.Text((40, 10), a.title, state.getColorPalette().getColor('item'), 20)
    pauseBtn = pyos.GUI.Button(((app.ui.width - 100), 0), 'Pause', state.getColorPalette().getColor('background'), state.getColorPalette().getColor('item'), 20, width=50, height=40, border=1, borderColor=state.getColorPalette().getColor('accent'), onClick=registerPauseClick, onClickData=(a, cont))
    stopBtn = pyos.GUI.Button(((app.ui.width - 50), 0), 'Stop', state.getColorPalette().getColor('background'), state.getColorPalette().getColor('item'), 20, width=50, height=40, border=1, borderColor=state.getColorPalette().getColor('accent'), onClick=registerStopClick, onClickData=(a, cont))
    if a.thread.pause:
        pauseBtn.textComponent.text = 'Resume'
        pauseBtn.refresh()
    if (a.thread.stop or a.thread.firstRun):
        stopBtn.textComponent.text = 'Start'
        pauseBtn.refresh()
        pauseBtn.textComponent.text = ' - '
        pauseBtn.refresh()
    cont.addChild(icon)
    cont.addChild(title)
    cont.addChild(pauseBtn)
    cont.addChild(stopBtn)
    return cont
def buildAppEntry(a):
    cont = pyos.GUI.Container((0, 0), color=state.getColorPalette().getColor('background'), width=(app.ui.width - 2), height=40)
    ic = a.getIcon()
    icon = None
    if (ic != False):
        icon = pyos.GUI.Image((0, 0), surface=a.getIcon())
    else:
        icon = pyos.GUI.Image((0, 0), surface=state.getIcons().getLoadedIcon('unknown'))
    title = pyos.GUI.Text((40, 10), a.title, state.getColorPalette().getColor('item'), 20)
    pauseBtn = pyos.GUI.Button(((app.ui.width - 100), 0), 'Pause', state.getColorPalette().getColor('background'), state.getColorPalette().getColor('item'), 20, width=50, height=40, border=1, borderColor=state.getColorPalette().getColor('accent'), onClick=registerPauseClick, onClickData=(a, cont))
    stopBtn = pyos.GUI.Button(((app.ui.width - 50), 0), 'Stop', state.getColorPalette().getColor('background'), state.getColorPalette().getColor('item'), 20, width=50, height=40, border=1, borderColor=state.getColorPalette().getColor('accent'), onClick=registerStopClick, onClickData=(a, cont))
    if a.thread.pause:
        pauseBtn.textComponent.text = 'Resume'
        pauseBtn.refresh()
    if (a.thread.stop or a.thread.firstRun):
        stopBtn.textComponent.text = 'Start'
        pauseBtn.refresh()
        pauseBtn.textComponent.text = ' - '
        pauseBtn.refresh()
    cont.addChild(icon)
    cont.addChild(title)
    cont.addChild(pauseBtn)
    cont.addChild(stopBtn)
    return cont