changeset 254:10b5f7f36dd4

* Fixed a small unicode bug for the dropdown menu
author nihathrael@33b003aa-7bff-0310-803a-e67f0ece8222
date Wed, 03 Jun 2009 19:29:52 +0000
parents 6ab09eb765a1
children 51cc05d862f2
files engine/extensions/pychan/widgets/dropdown.py engine/extensions/pychan/widgets/listbox.py
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/engine/extensions/pychan/widgets/dropdown.py	Fri May 08 08:45:27 2009 +0000
+++ b/engine/extensions/pychan/widgets/dropdown.py	Wed Jun 03 19:29:52 2009 +0000
@@ -38,7 +38,7 @@
 	def resizeToContent(self,recurse=True):
 		# We append a minimum value, so max() does not bail out,
 		# if no items are in the list
-		_item_widths = map(self.real_font.getWidth,map(str,self._items)) + [self.real_font.getHeight()]
+		_item_widths = map(self.real_font.getWidth, map(text2gui, map(unicode, self._items))) + [self.real_font.getHeight()]
 		max_w = max(_item_widths)
 		self.width = max_w
 		self.height = (self.real_font.getHeight() + 2)
--- a/engine/extensions/pychan/widgets/listbox.py	Fri May 08 08:45:27 2009 +0000
+++ b/engine/extensions/pychan/widgets/listbox.py	Wed Jun 03 19:29:52 2009 +0000
@@ -19,7 +19,7 @@
 
 	def getElementAt(self, i):
 		i = max(0,min(i,len(self) - 1))
-		return str(self[i])
+		return text2gui(unicode(self[i]))
 
 class ListBox(Widget):
 	"""