From: Chris b. R. <ch...@da...> - 2002-02-11 22:57:07
|
On Mon, Feb 11, 2002 at 03:00:39PM -0600, Brian Mattern muttered... : I haven't completed the timer stuff, but what is there should work. : First of all, make sure clock_update takes (object data, number val) as : its arguments. This is backwards from normal e timers, but for some : reason ferite would segfault if i had a non-object first parameter. : (Know anything about this boris? Maybe i'm just doing things wrong...) Hmmm, I will look into it - there is no reason why it shouldn't work. : The timers are a one time thing. It waits the specified time (at least, : sometimes a bit more) and then calls the function. In order to continue : you would have to call it again from within the function. : : I used the val parameter, as that is what raster used in the e timers. : It is just a number that can be used to do different things. For : instance, call it the first time with val = 0, do certain things the : first time only, and then incrememnt it each time through and use that to : know how far along you are. For alot of applications, its unecessary. : : An example snippet from an xmms epplet. this updates the title of a song: : : ----------------------------------------------------- : function testTimer(object data, number val) : { : string ti; : if (remote.getSession() != -1) : { : ti = remote.getSongTitle(); : data.setText(ti); : } : epp.addTimer("test", 0.5, "testTimer", 0, data); : } : : ---- alot of stuff here to set up the epplet, etc ----- : : epp.addTimer("test", 0.5, "testTimer", 0, title); : --------------------------------------------------- : : this then calls testTimer every .5 seconds, passing along an EvasObject : that is a text object. : : Hope this helps. When everything is complete, there will be a nice API : document to go along with it. I'll start commenting the ferite code a : bit more for now. This should be nicer once 0.99.5 is released I have re-worked the module system in ferite cvs [hence why it shouldn't be used yet] and the code for modules is much nicer :) No more %{ %} - ferite and builder are much cleverer :) Regards, Chris -- +------------------------------------------------------------------+ | Chris Ross | ch...@da... | ct...@fe... | | | http://www.darkrock.co.uk | http://www.ferite.org | +------------------------------------------------------------------+ "Change is inevitable -- except from a vending machine." |