On 29 February 2012 13:14, Tudor Girba <[email protected]> wrote:
> Hi,
>
> I was not criticizing your solution. I was actually asking for help :).
>
> I would like to get a text morph in the tree and have it scale both
> horizontally to fill the available space, and vertically to
> accommodate the entire text. I show the example with the
> GeneralScrollPane because I managed to make it work there (with the
> help of Gary), but I cannot do it on MorphTreeMorph. So, if you, or
> someone else, have ideas I would be happy to hear them.
>

Doru, i remember i was digging it some time before.
But didn't found good solution to the above.
The problem is that it is hard to figure out what happens in text
morph.. its too complicated thingy.

Then later, when i was implementing text rendering in Athens, i had to
make own text morph class,
because there are things which hard-wired.
And now to the point about the problem:
 determining text dimensions is constraint-solving problem.

I found the code there which actually takes initial bounds of morph
and tries to lay out text within those bounds.
Now if you want to make morph to stretch depending on text dimensions,
you actually creating a dependency loop,
because to lay out text you need bounds, but bounds are determined
from text size..

So, i fear that without some refactoring of paragraph/display scanner
/text morph, you simply cannot have a good solution.


> Cheers,
> Doru
>
>
>
> On Tue, Feb 28, 2012 at 10:09 AM, S Krish
> <[email protected]> wrote:
>> Sure.. that is fine.. for the use case you state
>>
>> Mine is quick n dirty hack to what I wanted:
>>
>> but my use case is I do wish to have more of these sources partially visible
>> through the vertical pane. so I restrain it to max of 210.. and width of 600
>> to be able to to throw up another pane next to it.. for grouping methods I
>> am interested in .. to view it more closely..
>>
>>
>>
>> On Tue, Feb 28, 2012 at 1:33 PM, Tudor Girba <[email protected]> wrote:
>>>
>>> Hi,
>>>
>>> Thanks for the explanation.
>>>
>>> I took a look. calculateExtent is triggered when you create the TextMorph.
>>> This is nice, but I am interested in getting the TextMorph to always expand
>>> to fill the width of the surrounding element, and to expand vertically
>>> according to the text :).
>>>
>>> Here is a variation of what I am thinking about with just a simple list of
>>> morphs within a GeneralScrollPane:
>>> https://gist.github.com/1930477
>>>
>>> Cheers,
>>> Doru
>>>
>>>
>>>
>>> On 28 Feb 2012, at 03:22, Krishsmalltalk wrote:
>>>
>>> > It does have the code to calculateTextExtent. You can modify it the way
>>> > you want.
>>> >
>>> > The height is defaulted to a max 210 and fixed 600. But on expand it
>>> > goes to max ht of 600
>>> >
>>> >
>>> > Modify the logic in that method as you want it to
>>> >
>>> >
>>> > On Feb 28, 2012, at 2:42 AM, Tudor Girba <[email protected]> wrote:
>>> >
>>> >> Hi,
>>> >>
>>> >> I gave it a try. I am not necessarily looking for the looks as for the
>>> >> solution to make the text editor within the tree span horizontally and
>>> >> vertically with the size of the method. Unfortunately, this does not 
>>> >> work in
>>> >> this example, either.
>>> >>
>>> >> Does anyone have ideas of how to make it work? :)
>>> >>
>>> >> Cheers,
>>> >> Doru
>>> >>
>>> >>
>>> >> On 27 Feb 2012, at 21:43, Stéphane Ducasse wrote:
>>> >>
>>> >>> MorphicViewNewPackageBrowser new packageNames: #('UIManager') ; open
>>> >>>
>>> >>>
>>> >>> But it does not look that nice :)
>>> >>>
>>> >>>
>>> >>> On Feb 27, 2012, at 6:42 PM, Stéphane Ducasse wrote:
>>> >>>
>>> >>>> this looks really nice.
>>> >>>> I would really like to see if we cannot include a version so that
>>> >>>> people can browse change set and other code like that.
>>> >>>> I'm really happy to see that the work done by alain and ben around
>>> >>>> treeMorph pays off that well.
>>> >>>>
>>> >>>> Stef
>>> >>>>
>>> >>>>
>>> >>>>> Can take the latest of the package..
>>> >>>>>
>>> >>>>> PackageTree-Browser-Experiment
>>> >>>>>
>>> >>>>> * Find class added and a crude/ workable expand for text morph..
>>> >>>>>
>>> >>>>> As stated in the comments: will require a hack in Pharo 1.4 for now.
>>> >>>>>
>>> >>>>> Will work towards integrating TabbedPane with TWM/ this too as an
>>> >>>>> addon with more complete features month ahead.
>>> >>>>> <Pharo_CodeBrowser02.JPG>
>>> >>>>
>>> >>>>
>>> >>>
>>> >>>
>>> >>
>>> >> --
>>> >> www.tudorgirba.com
>>> >>
>>> >> "One cannot do more than one can do."
>>> >>
>>> >>
>>> >>
>>> >>
>>> >
>>>
>>> --
>>> www.tudorgirba.com
>>>
>>> "Sometimes the best solution is not the best solution."
>>>
>>>
>>
>
>
>
> --
> www.tudorgirba.com
>
> "Every thing has its own flow"
>



-- 
Best regards,
Igor Stasenko.

Reply via email to