Stupid PyPop tricks
I've been playing with timers in PyPop (the current version has them enabled) because I had originally thought I'd do the directory monitor with a timer. Here's a neat little application for PyPop:
<ui>All it does is to show the frame and set up a timer that calls a "tick" command. The "tick" hides the frame if the state is "tick", and shows it if the state is "tock". End of story. The frame appears and disappears every second. When you've had enough, click on the close button quickly before it disappears. Ha.
<frame id="main" title="File monitor" h="100" w="200">
<html field="html">Nothing to see here, move along</html>
<timer field="timer" interval="1000" cmd="tick">
</frame>
<action id="initialize" lang="command" parms="">
set state tick
</action>
<action id="tick" lang="python" parms="">
state = [context]['state']
if state == 'tick':
: set state tock
: hide
else:
: set state tick
: show
</action>
</ui>
Try it! Remember: PyPop installer here at SourceForge.