[Pharo-users] GLMFormatedPresentation>>format bug?

Andrei Chis chisvasileandrei at gmail.com
Sun May 15 18:08:01 EDT 2016


Hi Alistair,

Try something like this. Now 100% sure it will work.

gtInspectIn: composite
        <gtInspectorPresentationOrder: 30>

        ^ composite text
                title: 'Meme';
                format: [self asText].

The display block should return the object to be displayed, which is this
case is self.

Cheers,
Andrei


On Sun, May 15, 2016 at 11:58 PM, Alistair Grant <akgrant0710 at gmail.com>
wrote:

> Hi All,
>
> I'm currently porting my personal documentation system from Python /
> Django to Pharo and am trying to display formatted text in a new pane in
> the inspector.  If I execute something like:
>
> | text |
>
> text := 'Hello World' asText.
> text addAttribute: TextColor green from: 1 to: 6.
> text
>
> in a playground using "Do it and go", the text is displayed correctly
> (with formatting).
>
> If I add a method in the object I want to inspect:
>
> gtInspectIn: composite
>         <gtInspectorPresentationOrder: 30>
>
>         ^ composite text
>                 title: 'Meme';
>                 display: [self asText].
>
> the formatting disappears.
>
> I'm able to "fix" the problem by changing:
>
> GLMFormatedPresentation>>format
>         ^ format ifNil: [ format := #asString ]
>
> to:
>
> GLMFormatedPresentation>>format
>         ^ format ifNil: [ format := #asText ]
>
> Is someone more knowledgable about Glamour able to confirm that this is
> really a bug?  If so, I'll submit a formal bug report on fogbugz.  (If
> there's a better solution, that would be great too).
>
> Thanks!
> Alistair
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-users_lists.pharo.org/attachments/20160516/94a536a7/attachment.html>


More information about the Pharo-users mailing list