Spec documentation and examples

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Spec documentation and examples

Daniela Meneses
Hi:

I'm starting to develop with pharo using spec. I really like the spec approach. I already review some examples that come with spec but I only get UIs with a bad aspect by following the examples.
I would like to find more documentation and examples about how to write the defaultSpec. Documentation about how to use the spec structure to develop a nice and usable UI.

Thanks in advance,
Daniela Meneses
Reply | Threaded
Open this post in threaded view
|

Re: Spec documentation and examples

Clément Béra
Hello,

I have no documentation but examples. Basically either :

- you choose to write the default spec with row and columns, you can precise height or row of some elements. With this method it is easier to get what you want but quite slow sometimes.

ex : (Inspector UI)
defaultSpec
<spec>
^ SpecLayout composed
newColumn: [:c |
c
newRow: [:row | 
row 
add: #list width: 135;
add: #description ];
newRow: [:row2 |
row2 add: #text ] height: 75 ];
yourself

- write down directly the position and size of elements

ex : (debugger UI)
defaultSpec
<spec: #default>

^ SpecLayout composed
add: #contextStackList origin: 0@0 corner: 1@0.30;
add: #debuggerToolBar origin: 0@0.30 corner: 1@0.30 offsetOrigin: 0@(-12.5) offsetCorner: 0@(12.5);
add: #currentMethodText origin: 0@0.30 corner: 1@0.70 offsetOrigin: 0@12.5 offsetCorner: 0@0;
add: #receiverInspector origin: 0@0.70 corner: 0.5@1 offsetOrigin: 0@4 offsetCorner: 0@0;
add: #contextVariableInspector origin: 0.5@0.70 corner: 1@1 offsetOrigin: 4@4 offsetCorner: 0@0;
yourself

The elements (for example #contextStackList) have to be both instance variables of the object and be initialized in initializedWidgets.
ex :
initializeWidgets
self instantiateModels: #(
contextStackList ListComposableModel
debuggerToolBar DebuggerToolBar
currentMethodText TextModel
receiverInspector EyeInspector
contextVariableInspector EyeInspector).

You can see the example I showed you on smalltalkhub : 
user: ClementBera
project: eye
class: EyeInspector
ex: 'Class ogle'

or

user: mate
project: AST-interpreter
Class: ASTDebuggerUI
ex: run ASTDebuggerTest>>#testAsSymbol 

I hope I was able to help you,

Clement

2013/3/25 Daniela Meneses <[hidden email]>
Hi:

I'm starting to develop with pharo using spec. I really like the spec approach. I already review some examples that come with spec but I only get UIs with a bad aspect by following the examples.
I would like to find more documentation and examples about how to write the defaultSpec. Documentation about how to use the spec structure to develop a nice and usable UI.

Thanks in advance,
Daniela Meneses

Reply | Threaded
Open this post in threaded view
|

Re: Spec documentation and examples

stephane ducasse
In reply to this post by Daniela Meneses
thnkas daniela

we should update the spec tutorial and turn it into a chapter.
Probably during the 14 hours train to the pharo conf we will give a try to fix it.

Stef


> Hi:
>
> I'm starting to develop with pharo using spec. I really like the spec approach. I already review some examples that come with spec but I only get UIs with a bad aspect by following the examples.
> I would like to find more documentation and examples about how to write the defaultSpec. Documentation about how to use the spec structure to develop a nice and usable UI.
>
> Thanks in advance,
> Daniela Meneses


Reply | Threaded
Open this post in threaded view
|

Re: Spec documentation and examples

philippeback
In reply to this post by Daniela Meneses
+10000 ....

2013/3/25 Daniela Meneses <[hidden email]>:

> Hi:
>
> I'm starting to develop with pharo using spec. I really like the spec
> approach. I already review some examples that come with spec but I only get
> UIs with a bad aspect by following the examples.
> I would like to find more documentation and examples about how to write the
> defaultSpec. Documentation about how to use the spec structure to develop a
> nice and usable UI.
>
> Thanks in advance,
> Daniela Meneses