[Newbies] Omnibrowser, italic Traits' method names

Robert Krahn robert.krahn at student.hpi.uni-potsdam.de
Sun Jun 24 00:18:33 UTC 2007

Am 24.06.2007 um 00:44 schrieb Juraj Kubelka:

> It is possible to use TextEmphasis>>bold now but TextColor>>green  
> attribute doesn't work.

Yes, thats why the standard colors in LazyListMorph overwrite your  
chosen color. LazyListMorph >>display: atRow:on: looks like that:

display: item  atRow: row on: canvas
	"display the given item at row row"
	| drawBounds |
	drawBounds := self drawBoundsForRow: row.
	drawBounds := drawBounds intersect: self bounds.
	item isText
		ifTrue: [ canvas drawString: item in: drawBounds font: (font  
emphasized: (item emphasisAt: 1)) color: (self colorForRow: row) ]
		ifFalse: [ canvas drawString: item in: drawBounds font: font color:  
(self colorForRow: row) ].

The item is your displayString but the color is changed to  
LazyListMorph >>colorForRow: which turns out to be the follow:

colorForRow: 	row
	^(selectedRow notNil and: [ row = selectedRow])
		ifTrue: [ Color red ]
		ifFalse: [ self color ].

It seems that those things are really in the guts of the system and  
because of that they cannot be parameterized easily (yet).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20070624/871e8036/attachment.htm

More information about the Beginners mailing list