I want to make a layout based on TableLayout. Taking SpecLayout as example, it seems that I also have to create model class similar to ContainerModel and adapter for it. However, I noticed that SpecInterpreter has some hardcoded behaviour for ContainerModel in computeSpecFrom:selector: method. Is this behaviour really important, and if yes, how can I replicate it? -- View this message in context: http://forum.world.st/Custom-layout-in-Spec-tp4762142.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
Hi, I donât know what your requirements are for a table layout, but have you tried using rows and columns? Maybe this can already solve your issue. Have a look at the documentation for Spec, maybe the PFTE book chapter can be of more help. At least it shows an example of use of rows and columns. https://ci.inria.fr/pharo-contribution/job/PharoForTheEnterprise/lastSuccess... On Jun 8, 2014, at 9:21 AM, webwarrior <reg@webwarrior.ws> wrote:
I want to make a layout based on TableLayout.
Taking SpecLayout as example, it seems that I also have to create model class similar to ContainerModel and adapter for it.
However, I noticed that SpecInterpreter has some hardcoded behaviour for ContainerModel in computeSpecFrom:selector: method. Is this behaviour really important, and if yes, how can I replicate it?
-- View this message in context: http://forum.world.st/Custom-layout-in-Spec-tp4762142.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
---> Save our in-boxes! http://emailcharter.org <--- Johan Fabry - http://pleiad.cl/~jfabry PLEIAD lab - Computer Science Department (DCC) - University of Chile
My main requirements are such that container respects sizes and resizing behaviour (hResizing, vResizing) of its child elements. Proportional layout doesn't allow that. And yes, I've read Spec documentation and some Morphic documentation. -- View this message in context: http://forum.world.st/Custom-layout-in-Spec-tp4762142p4762213.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
I have been able to get size respecting behavior using rows and columns, by giving newColumn:width: and newRow:width. Combined with splitters (the addSplitter message) this has worked well for me (modulo some bugs). If you need more complex behavior than that Iâm afraid I cannot help you. On Jun 8, 2014, at 3:39 PM, webwarrior <reg@webwarrior.ws> wrote:
My main requirements are such that container respects sizes and resizing behaviour (hResizing, vResizing) of its child elements.
Proportional layout doesn't allow that.
And yes, I've read Spec documentation and some Morphic documentation.
-- View this message in context: http://forum.world.st/Custom-layout-in-Spec-tp4762142p4762213.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
---> Save our in-boxes! http://emailcharter.org <--- Johan Fabry - http://pleiad.cl/~jfabry PLEIAD lab - Computer Science Department (DCC) - University of Chile
On 08 Jun 2014, at 15:21, webwarrior <reg@webwarrior.ws> wrote:
I want to make a layout based on TableLayout.
Short answer: itâs not really supported yet. If you want to give it a try, itâs really welcome ;)
However, I noticed that SpecInterpreter has some hardcoded behaviour for ContainerModel in computeSpecFrom:selector: method. Is this behaviour really important, and if yes, how can I replicate it?
Itâs really needed (even thought I do not remember why exactly now (but I think itâs to prevent some infinite loops)). The solution as I was thinking about it would be to have a different keyword per layout. Today, you start your layout with `SpecLayout composed`, where it could be `SpecLayout table`. Or it could be `SpecTableLayout composed`. The main issue you will have is that Spec does not directly rely on Morphic layouts. So you will have to implement some layouting algorithm by yourself. Hope it helps, Ben
I implemented SpecTableLayout, which uses TableLayout policy. Wasn't that hard, beacuse actual layouting *is* done in Morphic. Interface of SpecTableLayout is somewhat similar to SpecLayout. All table layout options are supported (see http://wiki.squeak.org/squeak/2340). One thing that is not part of TableLayout and was added by me is spacer - invisible element that is either fixed size or flexible (aka spring). Most Spec widgets were designed to occupy all available space, and in order to change that they may be wrapped into single-element table layout. This is done using #add:wrapped: or #add:withSpec:wrapped with last argument being block (a similar to #newRow: and #newColumn:). For example: Now I wonder how do I transfer these changes from Monticello to GitHub in order to make pull request? -- View this message in context: http://forum.world.st/Custom-layout-in-Spec-tp4762142p4762995.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
On 13 Jun 2014, at 17:09, webwarrior <reg@webwarrior.ws> wrote:
I implemented SpecTableLayout, which uses TableLayout policy.
Cool :)
Wasn't that hard, beacuse actual layouting *is* done in Morphic.
It is not. Thatâs exactly why SpecLayoutFrame exists by example. You can convert Spec layout into morphic layout to use in the case of Morphic but this is decoupled.
For example:
I do not see your example here :S Is my Mail.app missing to load a file or did you miss to insert something ?
Now I wonder how do I transfer these changes from Monticello to GitHub in order to make pull request?
clone the repository (as you will do for any other github project) then serialise your code via Monticello browser using âfiletree" Then you can commit, push, pull request Thanks, Ben
Wasn't that hard, beacuse actual layouting *is* done in Morphic.
It is not. Thatâs exactly why SpecLayoutFrame exists by example.
You can convert Spec layout into morphic layout to use in the case of Morphic but this is decoupled.
Now I see what you mean. But my aim was to make a layout that works here and now with Morphic.
For example:
I do not see your example here :S Is my Mail.app missing to load a file or did you miss to insert something ?
It was just a section of code. Maybe your mail client doesn't show html? It was the following: ^ SpecTableLayout row add: #toolbar wrapped: [ :e | e hResizing: #shrinkWrap ]; -- View this message in context: http://forum.world.st/Custom-layout-in-Spec-tp4762142p4763332.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
Ben On 16 Jun 2014, at 15:01, webwarrior <reg@webwarrior.ws> wrote:
Wasn't that hard, beacuse actual layouting *is* done in Morphic.
It is not. Thatâs exactly why SpecLayoutFrame exists by example.
You can convert Spec layout into morphic layout to use in the case of Morphic but this is decoupled.
Now I see what you mean. But my aim was to make a layout that works here and now with Morphic.
Ok :) But one of the goals of Spec is to not be Morphic specific
For example:
I do not see your example here :S Is my Mail.app missing to load a file or did you miss to insert something ?
It was just a section of code. Maybe your mail client doesn't show html?
Could be :s
It was the following:
^ SpecTableLayout row add: #toolbar wrapped: [ :e | e hResizing: #shrinkWrap ];
That sounds strange :) Ben
View this message in context: Re: Custom layout in Spec Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
participants (3)
-
Benjamin -
Johan Fabry -
webwarrior