logo       

Re: Omnibrowser, italic Traits' method names: msg#00098

lang.smalltalk.squeak.beginners

Subject: Re: Omnibrowser, italic Traits' method names


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).
_______________________________________________
Beginners mailing list
Beginners@xxxxxxxxxxxxxxxxxxxxxxxxxx
http://lists.squeakfoundation.org/mailman/listinfo/beginners
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise