[ekg2-commit] r3697 - trunk/contrib/ruby

svn w toxygen.net svn w toxygen.net
Sob, 26 Sty 2008, 22:01:16 CET


Author: darkjames
Date: 2008-01-26 22:01:16 +0100 (Sat, 26 Jan 2008)
New Revision: 3697

Modified:
   trunk/contrib/ruby/Sample.rb
Log:
[ruby] sample for command and timers.


Modified: trunk/contrib/ruby/Sample.rb
===================================================================
--- trunk/contrib/ruby/Sample.rb	2008-01-26 21:00:49 UTC (rev 3696)
+++ trunk/contrib/ruby/Sample.rb	2008-01-26 21:01:16 UTC (rev 3697)
@@ -7,16 +7,27 @@
 end
 
 class Ekg2::Script::Sample < Ekg2::Script
+	def handler_foo(parametr = nil)
+		if parametr != nil
+			print "Wywolane polecenie foo z parametrem: `" + parametr + "` !"
+		else
+			print "Wywolane polecenie foo bez parametrow!"
+		end
+	end
+
 	def handler_keypress(klawisz)
-		print "Nacisnales klawisz!: #" + klawisz.to_s;
+		print "Nacisnales klawisz!: #" + klawisz.to_s
 	end
 
+	def handler_czasomierz()
+		print "Czas plynie a dekoral wciaz bialy"
+	end
+
 	def initialize
 		super
-		handler_bind("ui-keypress", "handler_keypress")
+#		handler_bind("ui-keypress", "handler_keypress")
+		command_bind("foo", "handler_foo")
+		timer_bind(1, "handler_czasomierz");
 	end
 
-	def foo
-		print "super"
-	end
 end



Więcej informacji o liście dyskusyjnej ekg2-commit