Just a general remark: you should try as much as possible to avoid hard coding width/height :)there are some methods on ComposableModel you could use like buttonHeight toolbarHeight etc. that you should use instead :)
BenOn 07 Nov 2013, at 13:22, Bahman Movaqar <Bahman@BahmanM.com> wrote:On 11/07/2013 12:45, Cl�ment Bera wrote:
Hey,
I don't know what you want exactly.
You can do:
spec<spec>^ SpecLayout composednewRow: [:row |�row�� � � � � � � � � � � � � � � � newColumn: [ :col |� � � � � � � � � � � � � � � � coladd: #list width: 135;add: #description ] ];yourself
and nest that as many times as you want (but I don't know if this was your question).
I just tried this one and it works (see the code below) BUT, the code is so hard to read and understand just for 3 rows and 7 widgets!
<code>
defaultSpec
��� ^ SpecLayout composed
��� ��� newColumn: [ :mainColumn |
��� ��� ��� ��� ��� mainColumn
��� ��� ��� ��� ��� ��� newRow: [ :nameRow |
��� ��� ��� ��� ��� ��� ��� nameRow
��� ��� ��� ��� ��� ��� ��� ��� add: #labelName;
��� ��� ��� ��� ��� ��� ��� ��� add: #textName ]
��� ��� ��� ��� ��� ��� height: 25.
��� ��� ��� ��� ��� mainColumn
��� ��� ��� ��� ��� ��� newRow: [ :titleRow |
��� ��� ��� ��� ��� ��� ��� titleRow
��� ��� ��� ��� ��� ��� ��� ��� add: #labelTitle;
��� ��� ��� ��� ��� ��� ��� ��� newRow: [ :titleRadioRow |
��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� titleRadioRow
��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� add: #radioMr;
��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� add: #radioMrs;
��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� add: #radioMs ] ]
��� ��� ��� ��� ��� ��� height: 25.
��� ��� ��� ��� ��� mainColumn newRow: [ :buttonRow | buttonRow add: #buttonGreet ] height: 25 ];
��� ��� yourself
</code>
Am I doing it right?�
Another feature is:
debuggerSpec<spec: #default>^ SpecLayout composedadd: #inspector withSpec: #debuggerSpec;�yourself
#inspector being the instance variable name that holds a subclass of ComposableModel that defines class side #debuggerSpec, which answers a SpecLayout.
Does this mean that for every table cell I have to create a new class?
Not sure if this helped.
All of these questions are for your tutorials ?
2013/11/7 Bahman Movaqar <Bahman@bahmanm.com>
Hi all,
Is it possible to nest layouts in Spec? �For example can I combine
`SpecColumnLayout` and `SpecRowLayout` together?
-- Bahman Movaqar (http://BahmanM.com) ERP Evaluation, Implementation & Deployment Consultant PGP Key ID: 0x6AB5BD68 (keyserver2.pgp.com) -- Bahman Movaqar (http://BahmanM.com) ERP Evaluation, Implementation & Deployment Consultant PGP Key ID: 0x6AB5BD68 (keyserver2.pgp.com)