logo       

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

lang.smalltalk.squeak.beginners

Subject: Re: Omnibrowser, italic Traits' method names

Sorry, I don't want to spam you but I thought about a possible solution for that issue.

The first thing one could do is to subclass LazyListMorph to have a Morph which permits the displayStrings to keep their color. Then there is the need for a new PluggableListMorph which overrides PluggableListMorph >>listMorphClass to get this subclass of LazyListMorph. The next thing is to construct another OBMorphBuilder which changes #listMorphForColumn:.

Then a new builder exists which delivers browsers with the wanted property. I don't know if there are other classes which have to be changed (OBPane?) or if there is an easier solution. Please give me your opinion.

Robert 

Am 24.06.2007 um 02:18 schrieb Robert Krahn:


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 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