[Pharo-project] How to know 'real' extent of a PanelMorph
Hello, I have a panelMorph composed by several row/columns with different kind of morphs. What I would like to know is, what is the extent / size that I should use to FULLY display this panel (without scrollbars). Each time I ask for the extent of a panelMorph, it answers 50@40, whatever what is inside. If you openInWorld you will have something very very small. Is there a way to retrieve an extent with which the panel morph will be 'well' displayed (without having scrollbars everywhere)? In other words, what I really want to know is: Given two panelMorph, is there a way to say that one need more place than the other to be displayed?
Try #minExtent, though that won't cater for things with scrollbars. Perhaps worth re-implementing #optimalExtent to deal with those. Regards, Gary ----- Original Message ----- From: Cyrille Delaunay To: pharo-project Sent: Friday, May 20, 2011 2:34 PM Subject: [Pharo-project] How to know 'real' extent of a PanelMorph Hello, I have a panelMorph composed by several row/columns with different kind of morphs. What I would like to know is, what is the extent / size that I should use to FULLY display this panel (without scrollbars). Each time I ask for the extent of a panelMorph, it answers 50@40, whatever what is inside. If you openInWorld you will have something very very small. Is there a way to retrieve an extent with which the panel morph will be 'well' displayed (without having scrollbars everywhere)? In other words, what I really want to know is: Given two panelMorph, is there a way to say that one need more place than the other to be displayed?
Thanks gary. Indeed #minExtent give something interesting according the 'resizing strategy' of the submorphs (#rigid #spaceFill #shrinkWrap). If resizing of submorphs are #rigid, it works well. For example : |tmpPanelMorph| tmpPanelMorph := PanelMorph new changeTableLayout;hResizing: #shrinkWrap; vResizing: #shrinkWrap; listDirection: #leftToRight; yourself. tmpPanelMorph addMorphBack: ( (PluggableListMorph on: (ListModel new list: #(adededed ) ;yourself) list: #list selected: #selectionIndex changeSelected: #selectionIndex: ) hResizing: #rigid; vResizing: #rigid ; yourself) . tmpPanelMorph addMorphBack: ( (PluggableListMorph on: (ListModel new list: #(a b c d e f g h i j k l m n ) ;yourself) list: #list selected: #selectionIndex changeSelected: #selectionIndex: ) hResizing: #rigid; vResizing: #rigid ; yourself). tmpPanelMorph minExtent. The minExtent is 'correct'. Now if you try with: |tmpPanelMorph| tmpPanelMorph := PanelMorph new changeTableLayout;hResizing: #shrinkWrap; vResizing: #shrinkWrap; listDirection: #leftToRight; yourself. tmpPanelMorph addMorphBack: ( (PluggableListMorph on: (ListModel new list: #(adededed ) ;yourself) list: #list selected: #selectionIndex changeSelected: #selectionIndex: ) hResizing: #spaceFill; vResizing: #spaceFill ; yourself) . tmpPanelMorph addMorphBack: ( (PluggableListMorph on: (ListModel new list: #(a b c d e f g h i j k l m n ) ;yourself) list: #list selected: #selectionIndex changeSelected: #selectionIndex: ) hResizing: #spaceFill; vResizing: #spaceFill ; yourself). tmpPanelMorph minExtent. It answers something smaller. So I don't know if it would make sense to be able to retreive the same extent whatever the 'extending stratgies' of the submorphs ? Maybe another method that would always return this value (optimalExtent like you said) ? 2011/5/23 Gary Chambers <gazzaguru2@btinternet.com>
Try #minExtent, though that won't cater for things with scrollbars. Perhaps worth re-implementing #optimalExtent to deal with those.
Regards, Gary
----- Original Message ----- *From:* Cyrille Delaunay <cy.delaunay@gmail.com> *To:* pharo-project <Pharo-project@lists.gforge.inria.fr> *Sent:* Friday, May 20, 2011 2:34 PM *Subject:* [Pharo-project] How to know 'real' extent of a PanelMorph
Hello,
I have a panelMorph composed by several row/columns with different kind of morphs. What I would like to know is, what is the extent / size that I should use to FULLY display this panel (without scrollbars). Each time I ask for the extent of a panelMorph, it answers 50@40, whatever what is inside. If you openInWorld you will have something very very small. Is there a way to retrieve an extent with which the panel morph will be 'well' displayed (without having scrollbars everywhere)?
In other words, what I really want to know is: Given two panelMorph, is there a way to say that one need more place than the other to be displayed?
Cyrille I tried to understand what you need because minExtent seems to returns the minimum size that is required to display a morph. I tried your example and open the two morphs and everything looks fine. Did you check the implementation of minExtent because may be you can use it as a basis for optimalExtent? Stef On May 30, 2011, at 1:50 PM, Cyrille Delaunay wrote:
Thanks gary. Indeed #minExtent give something interesting according the 'resizing strategy' of the submorphs (#rigid #spaceFill #shrinkWrap). If resizing of submorphs are #rigid, it works well. For example :
|tmpPanelMorph| tmpPanelMorph := PanelMorph new changeTableLayout;hResizing: #shrinkWrap; vResizing: #shrinkWrap; listDirection: #leftToRight; yourself.
tmpPanelMorph addMorphBack: ( (PluggableListMorph on: (ListModel new list: #(adededed ) ;yourself) list: #list selected: #selectionIndex changeSelected: #selectionIndex: ) hResizing: #rigid; vResizing: #rigid ; yourself) . tmpPanelMorph addMorphBack: ( (PluggableListMorph on: (ListModel new list: #(a b c d e f g h i j k l m n ) ;yourself) list: #list selected: #selectionIndex changeSelected: #selectionIndex: ) hResizing: #rigid; vResizing: #rigid ; yourself).
tmpPanelMorph minExtent.
The minExtent is 'correct'. Now if you try with:
|tmpPanelMorph| tmpPanelMorph := PanelMorph new changeTableLayout;hResizing: #shrinkWrap; vResizing: #shrinkWrap; listDirection: #leftToRight; yourself.
tmpPanelMorph addMorphBack: ( (PluggableListMorph on: (ListModel new list: #(adededed ) ;yourself) list: #list selected: #selectionIndex changeSelected: #selectionIndex: ) hResizing: #spaceFill; vResizing: #spaceFill ; yourself) . tmpPanelMorph addMorphBack: ( (PluggableListMorph on: (ListModel new list: #(a b c d e f g h i j k l m n ) ;yourself) list: #list selected: #selectionIndex changeSelected: #selectionIndex: ) hResizing: #spaceFill; vResizing: #spaceFill ; yourself).
tmpPanelMorph minExtent.
It answers something smaller. So I don't know if it would make sense to be able to retreive the same extent whatever the 'extending stratgies' of the submorphs ? Maybe another method that would always return this value (optimalExtent like you said) ?
2011/5/23 Gary Chambers <gazzaguru2@btinternet.com> Try #minExtent, though that won't cater for things with scrollbars. Perhaps worth re-implementing #optimalExtent to deal with those.
Regards, Gary ----- Original Message ----- From: Cyrille Delaunay To: pharo-project Sent: Friday, May 20, 2011 2:34 PM Subject: [Pharo-project] How to know 'real' extent of a PanelMorph
Hello,
I have a panelMorph composed by several row/columns with different kind of morphs. What I would like to know is, what is the extent / size that I should use to FULLY display this panel (without scrollbars). Each time I ask for the extent of a panelMorph, it answers 50@40, whatever what is inside. If you openInWorld you will have something very very small. Is there a way to retrieve an extent with which the panel morph will be 'well' displayed (without having scrollbars everywhere)?
In other words, what I really want to know is: Given two panelMorph, is there a way to say that one need more place than the other to be displayed?
cyrille I was rereading your mail and I could not really understand what you are really looking for. Stef On May 20, 2011, at 3:34 PM, Cyrille Delaunay wrote:
Hello,
I have a panelMorph composed by several row/columns with different kind of morphs. What I would like to know is, what is the extent / size that I should use to FULLY display this panel (without scrollbars). Each time I ask for the extent of a panelMorph, it answers 50@40, whatever what is inside. If you openInWorld you will have something very very small. Is there a way to retrieve an extent with which the panel morph will be 'well' displayed (without having scrollbars everywhere)?
In other words, what I really want to know is: Given two panelMorph, is there a way to say that one need more place than the other to be displayed?
I would like a method that always return something like the first result (from the first example) , whatever the 'extending stratgies' of the submorphs (in my two examples, both would return the 'first' result). 2011/5/30 Stéphane Ducasse <stephane.ducasse@inria.fr>
cyrille
I was rereading your mail and I could not really understand what you are really looking for.
Stef
On May 20, 2011, at 3:34 PM, Cyrille Delaunay wrote:
Hello,
I have a panelMorph composed by several row/columns with different kind of morphs. What I would like to know is, what is the extent / size that I should use to FULLY display this panel (without scrollbars). Each time I ask for the extent of a panelMorph, it answers 50@40, whatever what is inside. If you openInWorld you will have something very very small. Is there a way to retrieve an extent with which the panel morph will be 'well' displayed (without having scrollbars everywhere)?
In other words, what I really want to know is: Given two panelMorph, is there a way to say that one need more place than the other to be displayed?
so I suggest that you just try to add optimalExtent based on minimal it does not seem that an existing method compute what you want. For me I still did not clearly get it. It seems that you want the potential space that a morph should occupy in the space of its container? Stef On May 31, 2011, at 9:51 AM, Cyrille Delaunay wrote:
I would like a method that always return something like the first result (from the first example) , whatever the 'extending stratgies' of the submorphs (in my two examples, both would return the 'first' result).
2011/5/30 Stéphane Ducasse <stephane.ducasse@inria.fr> cyrille
I was rereading your mail and I could not really understand what you are really looking for.
Stef
On May 20, 2011, at 3:34 PM, Cyrille Delaunay wrote:
Hello,
I have a panelMorph composed by several row/columns with different kind of morphs. What I would like to know is, what is the extent / size that I should use to FULLY display this panel (without scrollbars). Each time I ask for the extent of a panelMorph, it answers 50@40, whatever what is inside. If you openInWorld you will have something very very small. Is there a way to retrieve an extent with which the panel morph will be 'well' displayed (without having scrollbars everywhere)?
In other words, what I really want to know is: Given two panelMorph, is there a way to say that one need more place than the other to be displayed?
2011/5/31 Stéphane Ducasse <stephane.ducasse@inria.fr>
so I suggest that you just try to add optimalExtent based on minimal it does not seem that an existing method compute what you want.
For me I still did not clearly get it. It seems that you want the potential space that a morph should occupy in the space of its container?
Yes :)
Stef On May 31, 2011, at 9:51 AM, Cyrille Delaunay wrote:
I would like a method that always return something like the first result (from the first example) , whatever the 'extending stratgies' of the submorphs (in my two examples, both would return the 'first' result).
2011/5/30 Stéphane Ducasse <stephane.ducasse@inria.fr> cyrille
I was rereading your mail and I could not really understand what you are really looking for.
Stef
On May 20, 2011, at 3:34 PM, Cyrille Delaunay wrote:
Hello,
I have a panelMorph composed by several row/columns with different kind of morphs. What I would like to know is, what is the extent / size that I should use to FULLY display this panel (without scrollbars). Each time I ask for the extent of a panelMorph, it answers 50@40, whatever what is inside. If you openInWorld you will have something very very small. Is there a way to retrieve an extent with which the panel morph will be 'well' displayed (without having scrollbars everywhere)?
In other words, what I really want to know is: Given two panelMorph, is there a way to say that one need more place than the other to be displayed?
participants (3)
-
Cyrille Delaunay -
Gary Chambers -
Stéphane Ducasse