[Pharo-project] Customizing the Caret of a PluggableTextMorph

Fernando Olivero fernando.olivero at usi.ch
Fri Jul 20 06:17:09 EDT 2012


Hi Sean, you can take a look at Athens-PangoCairo (in squeaksource).

Using NativeBoost, i'm using the Pango layout library [1], and the
Pango-Cairo binding [2],  to avoid laying out text using the outdated
(and messy) stuff in the image.

Check out the classes: ParagraphDescription & AthensPangoCairoParagraph.

I'm using them as the basis for the TextShape,LabelShape, and
EditableTextShape in Shapes / Gaucho ( using TextEditor,
SingleLineEditor ).

Maybe somebody can do the same for Morphic? use Pango to layout the
text, and code a new TextMorph on top of it?

Fernando

[1] http://developer.gnome.org/pango/stable/pango-Layout-Objects.html
[2] http://developer.gnome.org/pango/stable/pango-Cairo-Rendering.html
On Wed, Jul 18, 2012 at 7:28 AM, Stéphane Ducasse
<stephane.ducasse at inria.fr> wrote:
>
> On Jul 16, 2012, at 9:38 PM, Sean P. DeNigris wrote:
>
>> For VimPharo, I want to have a different cursor depending on whether a tool
>> is in insert or normal mode.
>>
>> I tried a handful of ways, but they all failed or worked
>> partially/inconsistently. Here's some of them:
>> * add the state to the paragraph, but the entire paragraph gets replaced
>> during the life of the tool, so the state gets lost
>> * add the state to the editor, but the situation is the same
>> * add the state to PluggableTextMorph, override and access it from
>> TextMorphForEditView>>updateFromParagraph. This was an extreme PITA and got
>> me very acquainted with the emergency evaluator. It "worked", but only after
>> using the arrows a bit.
>>
>> Does anyone have any idea where I might hook in?
>>
>> <rant>I find the whole text system very confusing. What the heck does a
>> paragraph know about insertion points?? A view has one paragraph object,
>> even if there are several paragraphs (as understood by the rest of humanity
>> as a block of text with breaks between the adjoining ones. Editors and
>> Paragraphs are thrown out and replaced on a whim. I'm finding it very hard
>> to understand and modify</rant>
>
> I got burned by that when I worked on my botanics env….
> it was terrible.
>
>>
>> Thanks,
>> Sean
>>
>> --
>> View this message in context: http://forum.world.st/Customizing-the-Caret-of-a-PluggableTextMorph-tp4640245.html
>> Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
>>
>
>




More information about the Pharo-dev mailing list