From stern.taler at arcor.de Tue Mar 16 14:18:42 2010 From: stern.taler at arcor.de (Esther) Date: Tue Mar 16 14:18:44 2010 Subject: [UI] Centering elements in TableLayout Message-ID: <1268749122118-1594908.post@n4.nabble.com> Hi, I'm trying to do the following: I have a morph for which I set TableLayout as layout Policy. List direction is topToBottom. Then I add some rectangular morphs with a centered string morph in each of them (serving as label). Most of the rectangular morphs are placed exactly one below the other, but some of them (which have a longer label) are placed out of the row. http://n4.nabble.com/file/n1594908/notInALine.jpg So I wonder how to get them all in a row with table layout. Everything I tried by now (listCentering- and cellPositioning-values) did not work for me. The only thing that a first seemed to work was listCentering: #justified, but then vertical spaces increase (for some reason I don't understand) when I scroll the field. Can anyone give me a hint how to solve this problem? -- View this message in context: http://n4.nabble.com/Centering-elements-in-TableLayout-tp1594908p1594908.html Sent from the Squeak - UI mailing list archive at Nabble.com. From asqueaker at gmail.com Tue Mar 16 15:00:10 2010 From: asqueaker at gmail.com (Chris Muller) Date: Tue Mar 16 15:00:20 2010 Subject: [UI] Centering elements in TableLayout In-Reply-To: <1268749122118-1594908.post@n4.nabble.com> References: <1268749122118-1594908.post@n4.nabble.com> Message-ID: You might check your wrap setting, see that it's off. I think cellPositioning should be on the parent element, the container of the others, and set to #center.. On Tue, Mar 16, 2010 at 9:18 AM, Esther wrote: > > Hi, > > I'm trying to do the following: > > I have a morph for which I set TableLayout as layout Policy. List direction > is topToBottom. Then I add some rectangular morphs with a centered string > morph in each of them (serving as label). Most of the rectangular morphs are > placed exactly one below the other, but some of them (which have a longer > label) are placed out of the row. > > http://n4.nabble.com/file/n1594908/notInALine.jpg > > So I wonder how to get them all in a row with table layout. Everything I > tried by now (listCentering- and cellPositioning-values) did not work for > me. The only thing that a first seemed to work was listCentering: > #justified, but then vertical spaces increase (for some reason I don't > understand) when I scroll the field. > > Can anyone give me a hint how to solve this problem? > -- > View this message in context: http://n4.nabble.com/Centering-elements-in-TableLayout-tp1594908p1594908.html > Sent from the Squeak - UI mailing list archive at Nabble.com. > _______________________________________________ > UI mailing list > UI@lists.squeakfoundation.org > http://lists.squeakfoundation.org/mailman/listinfo/ui > From stern.taler at arcor.de Tue Mar 16 16:12:15 2010 From: stern.taler at arcor.de (Esther) Date: Tue Mar 16 16:12:17 2010 Subject: [UI] Centering elements in TableLayout In-Reply-To: References: <1268749122118-1594908.post@n4.nabble.com> Message-ID: <1226903594.20100316171207@arcor.de> Tuesday, March 16, 2010, 4:00:33 PM, you wrote: > You might check your wrap setting, see that it's off. I think > cellPositioning should be on the parent element, the container of the > others, and set to #center.. Thanks for your quick answer. Which wrap setting do you mean? #wrapDirection is set to none, #wrapDirection is by default set to #topLeft. I already tried to set cellPositioning: #center for the container, but unfortunately it doesn't work. It seems as if the following combination works: vResizing: #shrinkWrap; listCentering: #justified; wrapCentering: #center. #shrinkWrap avoids the spaces from getting bigger while scrolling, listCentering: #justified puts the inner elements below each other and wrapCentering: #center puts everything to the center. But I don't really understand how this works and why listCentering: #center is not the right option...Morphics and LayoutPolicies seem to be some kind of dark magic. Greetings, Esther -- View this message in context: http://n4.nabble.com/Centering-elements-in-TableLayout-tp1594908p1595140.html Sent from the Squeak - UI mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/ui/attachments/20100316/3bafb6a1/attachment.htm