pharo-graphics / Toplo

A widget framework on top of Bloc
MIT License
17 stars 8 forks source link

ToMiniBrowser open -> breaks! #79

Closed Ducasse closed 5 months ago

Ducasse commented 7 months ago

Here is the fix

onInstalledIn: anAlbum

    "Is sent when I am added to an element "

    super onInstalledIn: anAlbum.
    anAlbum whenTextReplacedDo: [ :t | self requestTextStyle ].
    anAlbum editorDo: [:ed | ed when: AlbTextEditedEvent do: [ :t | self requestTextStyle ]].

    self text: ''
Ducasse commented 7 months ago

Then an instance of OpalCompiler does not understand isScripting: self isForWorkspace;

privateStyle: aText

    | ast compiler |
    compiler := self isForWorkspace
                    ifTrue: [
                        OpalCompiler new
                            context: thisContext;
                            yourself ]
                    ifFalse: [ classOrMetaClass compiler ].
    ast := compiler
               source: aText asString;
               isScripting: self isForWorkspace;
               options:
                   #( #+ optionParseErrors #+ optionSkipSemanticWarnings );
               requestor: workspace;
               bindings: (workspace
                        ifNotNil: [ workspace bindings ]
                        ifNil: [ SystemDictionary new ]);
               parse.
    self style: aText ast: ast.
    fontName ifNotNil: [ aText fontName: fontName ].
    ^ aText
plantec commented 7 months ago

thanks. broken since P12. and BlTextStyler should be revised too

Ducasse commented 7 months ago

are you working in P12 because I tested it in P11.

plantec commented 7 months ago

ah yes, I'm on P12. difficult to have a it working on the two versions. I intend to fix it for P12.

tinchodias commented 5 months ago

I got several errors in P12, regarding packages, organizer, etc. May be @jecisc knows if it is possible to make it work in both P11 and 12?

jecisc commented 5 months ago

Regarding packages it depends on what we need.

In Moose I improved a project I have called PharoBackwardCompatibility to help with the transition. The goal of this project is to load some API of recent Pharo version in older Pharo. So what I did is that I added the new methods from P12 we needed in Moose in P11 and I use them in Moose.

https://github.com/jecisc/PharoBackwardCompatibility

We could add some more that are needed by Toplo.

Ducasse commented 5 months ago

I would prefer to move to P12 all the development. Thales guys are maintaining old versions and do not do backport. Let us keep things simple.

Martin can you

plantec commented 5 months ago

Toplo + Album are already in Pharo-graphics. Afaik, Thales use the last version of Toplo now. They keep old versions for old projects only

plantec commented 5 months ago

These examples can be ported to P12, no bad consequences

Ducasse commented 5 months ago

Cool :) I think that the issue was too old anyway because I probably used the wrong branch.