diff clients/pychan_demo/pychan_test.py @ 228:756b895e1dab

Merged unicode-support back into trunk. Now all GUI/visible strings should be unicode. Internal strings unchanged. Remember to use a font that actually has the desired codepoints. Current default unicode policiy is 'ignore'.
author phoku@33b003aa-7bff-0310-803a-e67f0ece8222
date Sat, 21 Mar 2009 10:38:11 +0000
parents c050f257cec3
children 51cc05d862f2
line wrap: on
line diff
--- a/clients/pychan_demo/pychan_test.py	Fri Mar 20 15:17:28 2009 +0000
+++ b/clients/pychan_demo/pychan_test.py	Sat Mar 21 10:38:11 2009 +0000
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# -*- coding: utf-8 -*-
 # coding: utf-8
 # This is the pychan demo client for FIFE.
 
@@ -36,28 +37,32 @@
 			self.widget.hide()
 		self.widget = None
 
-def testTimer():
-	import timer
-	timer.init( pychan.manager.hook.engine.getTimeManager() )
-	def spam():
-		print "SPAM SPAM"
-		return 1
-	repeater = timer.repeatCall(500,spam)
-	def stop_spam():
-		repeater.stop()
-		print "BACON EGGS AND SPAM"
-	timer.delayCall(5000,stop_spam)
+#def testTimer():
+	#import timer
+	#timer.init( pychan.manager.hook.engine.getTimeManager() )
+	#def spam():
+		#print "SPAM SPAM"
+		#return 1
+	#repeater = timer.repeatCall(500,spam)
+	#def stop_spam():
+		#repeater.stop()
+		#print "BACON EGGS AND SPAM"
+	#timer.delayCall(5000,stop_spam)
 
 
 class DemoApplication(basicapplication.ApplicationBase):
 	def __init__(self):
 		super(DemoApplication,self).__init__()
 		
-		pychan.init(self.engine,debug=True)
+		pychan.init(self.engine,debug=False)
+		pychan.loadFonts("fonts/freefont.fontdef")
+		pychan.manager.setDefaultFont("FreeSans")
+		#pychan.manager.setDefaultFont("Kochi")
 		pychan.setupModalExecution(self.mainLoop,self.breakFromMainLoop)
 		
 		self.gui = pychan.loadXML('gui/demoapp.xml')
-		
+		self.gui.findChild(name="xmlSource").font = "FreeMono"
+
 		eventMap = {
 			'creditsLink'  : self.showCredits,
 			'closeButton'  : self.quit,
@@ -91,7 +96,6 @@
 		
 		self.currentExample = None
 		self.creditsWidget = None
-		testTimer()
 
 	def selectExample(self):
 		if self.demoList.selected_item is None: return