Thursday, February 08, 2007

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>
<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>
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.

Try it! Remember: PyPop installer here at SourceForge.

3 Comments:

At 3:14 AM, Blogger Thomas desloges said...

You still alive?

 
At 10:52 PM, Blogger Michael said...

Agh - barely.

See, the weather was suddenly very wintery and we went sledding a whole lot (we've lived in Puerto Rico for two years, so winter is something pretty novel for our seven-year-old). For about two weeks, I had half-days of work which I'd start groggy and exhausted after two hours in 5-degree weather followed by a nice big burrito at Bajio.

Well, the problem was that I had a truly huge job looming, a full book on Unicode in SAP (I do technical translation for the real money) - a job which is still not done, although its deadline is tomorrow morning. Not Good, and I've been working morning, noon, and night for a week now, trying to get it as done as possible.

So as soon as *that* is done, and then as soon as all the *rest* of the queued work is done, and then as soon as our latest *move* is done (we're going back to Puerto Rico on March 15th) then I might start conceiving of the possibility of thinking about the remote memory of something resembling free time.

Seriously -- in the next week I should have a little more time to get back to it. Weather -- whaddaya want? (But the sledding was fantastic!)

 
At 7:44 PM, Blogger Thomas desloges said...

Well the real world is so much more important then the virtual one, so I don't blame you.

 

Post a Comment

<< Home