Ian Ward wrote:
> Joern Koerner wrote:
>> Hi everyone!
>>
>> Based on some posts to this list I've created a Border class, that draws ba 
>> border with title around widgets. So far so good. 
>>
>> My problem is, when I tray to change the borders color,  only the top line 
>> and the bottom line are being ignored. They simply does not change the color 
>> and I can 
>> not figure out where the bug is....
>> Perhaps someone could give me a hint what is wrong?!
>>
> 
> Interesting, it seems to be a Columns caching bug.  The colour changes
> when you change the width of the window and it is forced to be redrawn.
> 
> I'll have a look and let you know.

Please try the attached patch and verify that it fixes the problem you
found.

Ian
diff -r a80ebfc6c32a urwid/canvas.py
--- a/urwid/canvas.py	Mon Jun 09 12:49:05 2008 -0400
+++ b/urwid/canvas.py	Sun Jun 22 17:06:43 2008 -0400
@@ -699,12 +699,18 @@
 		intact."""
 		if self.widget_info:
 			raise self._finalized_error
+
+		shards = []
 		
-		for num_rows, cviews in self.shards:
-			for i in range(len(cviews)):
-				cv = cviews[i]
+		for num_rows, original_cviews in self.shards:
+			new_cviews = []
+			for cv in original_cviews:
 				if cv[4] is None:
-					cviews[i] = cv[:4] + (a,) + cv[5:]
+					new_cviews.append(cv[:4] + (a,) + cv[5:])
+				else:
+					new_cviews.append(cv)
+			shards.append((num_rows, new_cviews))
+		self.shards = shards
 
 	def set_depends(self, widget_list):
 		"""
_______________________________________________
Urwid mailing list
[email protected]
http://lists.excess.org/mailman/listinfo/urwid

Reply via email to