my mistake on Spec?

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

my mistake on Spec?

Yuriy Babah
Hi!
I'm trying to write GUI element with Spec, Pharo6.1x64 on Linux.
Do according to the SpecBooklet.

Finished the fragment, and try do:

ui := GUI_ListCourtCase new openWithSpec . -> #value was sent to nil.

I look in a debugger and:

openWithSpecLayout: aSpec
    "Build the widget using the spec name provided as argument and display it into a window"

    (window value notNil and: [ self needRebuild not ])
        ifTrue: [ "window != nil"
            window value rebuildWithSpecLayout: aSpec ]
        ifFalse: [  "If value = Nil   --> send him a message ???"
            window value: (self defaultWindowModelClass new model: self).
            window value openWithSpecLayout: aSpec.
            self takeKeyboardFocus ].
       
    ^ window value

Reply | Threaded
Open this post in threaded view
|

Re: my mistake on Spec?

Stephane Ducasse-3
Hi Yuriy

this is difficult to debug remotely. Do you have your code somewhere?

Stef

On Sat, Mar 3, 2018 at 8:41 AM, Yuriy Babah <[hidden email]> wrote:

> Hi!
> I'm trying to write GUI element with Spec, Pharo6.1x64 on Linux.
> Do according to the SpecBooklet.
>
> Finished the fragment, and try do:
>
> ui := GUI_ListCourtCase new openWithSpec . -> #value was sent to nil.
>
> I look in a debugger and:
>
> openWithSpecLayout: aSpec
>     "Build the widget using the spec name provided as argument and display
> it into a window"
>
>     (window value notNil and: [ self needRebuild not ])
>         ifTrue: [ "window != nil"
>             window value rebuildWithSpecLayout: aSpec ]
>         ifFalse: [  "If value = Nil   --> send him a message ???"
>             window value: (self defaultWindowModelClass new model: self).
>             window value openWithSpecLayout: aSpec.
>             self takeKeyboardFocus ].
>
>     ^ window value

Reply | Threaded
Open this post in threaded view
|

Re: my mistake on Spec?

Yuriy Babah
Is it enough if I just attach it?

I slightly changed the code
, that leads to error: "DoesNotUndestand #plaintiffsTextInput" .

Now I'm studying Help on Spec in SystemBrowser .



2018-03-04 15:23 GMT+03:00 Stephane Ducasse <[hidden email]>:
Hi Yuriy

this is difficult to debug remotely. Do you have your code somewhere?

Stef

On Sat, Mar 3, 2018 at 8:41 AM, Yuriy Babah <[hidden email]> wrote:
> Hi!
> I'm trying to write GUI element with Spec, Pharo6.1x64 on Linux.
> Do according to the SpecBooklet.
>
> Finished the fragment, and try do:
>
> ui := GUI_ListCourtCase new openWithSpec . -> #value was sent to nil.
>
> I look in a debugger and:
>
> openWithSpecLayout: aSpec
>     "Build the widget using the spec name provided as argument and display
> it into a window"
>
>     (window value notNil and: [ self needRebuild not ])
>         ifTrue: [ "window != nil"
>             window value rebuildWithSpecLayout: aSpec ]
>         ifFalse: [  "If value = Nil   --> send him a message ???"
>             window value: (self defaultWindowModelClass new model: self).
>             window value openWithSpecLayout: aSpec.
>             self takeKeyboardFocus ].
>
>     ^ window value



LegalBasis.st (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: my mistake on Spec?

Yuriy Babah
changed

2018-03-04 16:20 GMT+03:00 Yuriy Babah <[hidden email]>:
Is it enough if I just attach it?

I slightly changed the code
, that leads to error: "DoesNotUndestand #plaintiffsTextInput" .

Now I'm studying Help on Spec in SystemBrowser .



2018-03-04 15:23 GMT+03:00 Stephane Ducasse <[hidden email]>:
Hi Yuriy

this is difficult to debug remotely. Do you have your code somewhere?

Stef

On Sat, Mar 3, 2018 at 8:41 AM, Yuriy Babah <[hidden email]> wrote:
> Hi!
> I'm trying to write GUI element with Spec, Pharo6.1x64 on Linux.
> Do according to the SpecBooklet.
>
> Finished the fragment, and try do:
>
> ui := GUI_ListCourtCase new openWithSpec . -> #value was sent to nil.
>
> I look in a debugger and:
>
> openWithSpecLayout: aSpec
>     "Build the widget using the spec name provided as argument and display
> it into a window"
>
>     (window value notNil and: [ self needRebuild not ])
>         ifTrue: [ "window != nil"
>             window value rebuildWithSpecLayout: aSpec ]
>         ifFalse: [  "If value = Nil   --> send him a message ???"
>             window value: (self defaultWindowModelClass new model: self).
>             window value openWithSpecLayout: aSpec.
>             self takeKeyboardFocus ].
>
>     ^ window value




LegalBasis.st (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: my mistake on Spec?

Stephane Ducasse-3
Hi yuri

some feedback before looking into spec.
tab method bodies
then do not use instance variables with uppercase.

Stef


On Sun, Mar 4, 2018 at 2:26 PM, Yuriy Babah <[hidden email]> wrote:

> changed
>
> 2018-03-04 16:20 GMT+03:00 Yuriy Babah <[hidden email]>:
>>
>> Is it enough if I just attach it?
>>
>> I slightly changed the code, that leads to error: "DoesNotUndestand
>> #plaintiffsTextInput" .
>>
>> Now I'm studying Help on Spec in SystemBrowser .
>>
>>
>>
>> 2018-03-04 15:23 GMT+03:00 Stephane Ducasse <[hidden email]>:
>>>
>>> Hi Yuriy
>>>
>>> this is difficult to debug remotely. Do you have your code somewhere?
>>>
>>> Stef
>>>
>>> On Sat, Mar 3, 2018 at 8:41 AM, Yuriy Babah <[hidden email]>
>>> wrote:
>>> > Hi!
>>> > I'm trying to write GUI element with Spec, Pharo6.1x64 on Linux.
>>> > Do according to the SpecBooklet.
>>> >
>>> > Finished the fragment, and try do:
>>> >
>>> > ui := GUI_ListCourtCase new openWithSpec . -> #value was sent to nil.
>>> >
>>> > I look in a debugger and:
>>> >
>>> > openWithSpecLayout: aSpec
>>> >     "Build the widget using the spec name provided as argument and
>>> > display
>>> > it into a window"
>>> >
>>> >     (window value notNil and: [ self needRebuild not ])
>>> >         ifTrue: [ "window != nil"
>>> >             window value rebuildWithSpecLayout: aSpec ]
>>> >         ifFalse: [  "If value = Nil   --> send him a message ???"
>>> >             window value: (self defaultWindowModelClass new model:
>>> > self).
>>> >             window value openWithSpecLayout: aSpec.
>>> >             self takeKeyboardFocus ].
>>> >
>>> >     ^ window value
>>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: my mistake on Spec?

Stephane Ducasse-3
I'm doing a pass on your code

OrderedCollection new is better to me than #() asOrderedCollection.

GUI_ListCourtCase new openWithSpec
=> DNU
So I added the first missing method, but you should define the
corresponding methods in the class.







On Sun, Mar 4, 2018 at 2:28 PM, Stephane Ducasse
<[hidden email]> wrote:

> Hi yuri
>
> some feedback before looking into spec.
> tab method bodies
> then do not use instance variables with uppercase.
>
> Stef
>
>
> On Sun, Mar 4, 2018 at 2:26 PM, Yuriy Babah <[hidden email]> wrote:
>> changed
>>
>> 2018-03-04 16:20 GMT+03:00 Yuriy Babah <[hidden email]>:
>>>
>>> Is it enough if I just attach it?
>>>
>>> I slightly changed the code, that leads to error: "DoesNotUndestand
>>> #plaintiffsTextInput" .
>>>
>>> Now I'm studying Help on Spec in SystemBrowser .
>>>
>>>
>>>
>>> 2018-03-04 15:23 GMT+03:00 Stephane Ducasse <[hidden email]>:
>>>>
>>>> Hi Yuriy
>>>>
>>>> this is difficult to debug remotely. Do you have your code somewhere?
>>>>
>>>> Stef
>>>>
>>>> On Sat, Mar 3, 2018 at 8:41 AM, Yuriy Babah <[hidden email]>
>>>> wrote:
>>>> > Hi!
>>>> > I'm trying to write GUI element with Spec, Pharo6.1x64 on Linux.
>>>> > Do according to the SpecBooklet.
>>>> >
>>>> > Finished the fragment, and try do:
>>>> >
>>>> > ui := GUI_ListCourtCase new openWithSpec . -> #value was sent to nil.
>>>> >
>>>> > I look in a debugger and:
>>>> >
>>>> > openWithSpecLayout: aSpec
>>>> >     "Build the widget using the spec name provided as argument and
>>>> > display
>>>> > it into a window"
>>>> >
>>>> >     (window value notNil and: [ self needRebuild not ])
>>>> >         ifTrue: [ "window != nil"
>>>> >             window value rebuildWithSpecLayout: aSpec ]
>>>> >         ifFalse: [  "If value = Nil   --> send him a message ???"
>>>> >             window value: (self defaultWindowModelClass new model:
>>>> > self).
>>>> >             window value openWithSpecLayout: aSpec.
>>>> >             self takeKeyboardFocus ].
>>>> >
>>>> >     ^ window value
>>>>
>>>
>>

LegalBasis.st (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: my mistake on Spec?

Yuriy Babah
Thanks for your help, Stef.
Mistakes remain, but I will try to understand them

2018-03-04 16:35 GMT+03:00 Stephane Ducasse <[hidden email]>:
I'm doing a pass on your code

OrderedCollection new is better to me than #() asOrderedCollection.

GUI_ListCourtCase new openWithSpec
=> DNU
So I added the first missing method, but you should define the
corresponding methods in the class.







On Sun, Mar 4, 2018 at 2:28 PM, Stephane Ducasse
<[hidden email]> wrote:
> Hi yuri
>
> some feedback before looking into spec.
> tab method bodies
> then do not use instance variables with uppercase.
>
> Stef
>
>
> On Sun, Mar 4, 2018 at 2:26 PM, Yuriy Babah <[hidden email]> wrote:
>> changed
>>
>> 2018-03-04 16:20 GMT+03:00 Yuriy Babah <[hidden email]>:
>>>
>>> Is it enough if I just attach it?
>>>
>>> I slightly changed the code, that leads to error: "DoesNotUndestand
>>> #plaintiffsTextInput" .
>>>
>>> Now I'm studying Help on Spec in SystemBrowser .
>>>
>>>
>>>
>>> 2018-03-04 15:23 GMT+03:00 Stephane Ducasse <[hidden email]>:
>>>>
>>>> Hi Yuriy
>>>>
>>>> this is difficult to debug remotely. Do you have your code somewhere?
>>>>
>>>> Stef
>>>>
>>>> On Sat, Mar 3, 2018 at 8:41 AM, Yuriy Babah <[hidden email]>
>>>> wrote:
>>>> > Hi!
>>>> > I'm trying to write GUI element with Spec, Pharo6.1x64 on Linux.
>>>> > Do according to the SpecBooklet.
>>>> >
>>>> > Finished the fragment, and try do:
>>>> >
>>>> > ui := GUI_ListCourtCase new openWithSpec . -> #value was sent to nil.
>>>> >
>>>> > I look in a debugger and:
>>>> >
>>>> > openWithSpecLayout: aSpec
>>>> >     "Build the widget using the spec name provided as argument and
>>>> > display
>>>> > it into a window"
>>>> >
>>>> >     (window value notNil and: [ self needRebuild not ])
>>>> >         ifTrue: [ "window != nil"
>>>> >             window value rebuildWithSpecLayout: aSpec ]
>>>> >         ifFalse: [  "If value = Nil   --> send him a message ???"
>>>> >             window value: (self defaultWindowModelClass new model:
>>>> > self).
>>>> >             window value openWithSpecLayout: aSpec.
>>>> >             self takeKeyboardFocus ].
>>>> >
>>>> >     ^ window value
>>>>
>>>
>>

Reply | Threaded
Open this post in threaded view
|

Re: my mistake on Spec?

Stephane Ducasse-3
First implement all the missing methods that you use in the spec class method.
Then let us know.

Stef


On Sun, Mar 4, 2018 at 2:56 PM, Yuriy Babah <[hidden email]> wrote:

> Thanks for your help, Stef.
> Mistakes remain, but I will try to understand them
>
> 2018-03-04 16:35 GMT+03:00 Stephane Ducasse <[hidden email]>:
>>
>> I'm doing a pass on your code
>>
>> OrderedCollection new is better to me than #() asOrderedCollection.
>>
>> GUI_ListCourtCase new openWithSpec
>> => DNU
>> So I added the first missing method, but you should define the
>> corresponding methods in the class.
>>
>>
>>
>>
>>
>>
>>
>> On Sun, Mar 4, 2018 at 2:28 PM, Stephane Ducasse
>> <[hidden email]> wrote:
>> > Hi yuri
>> >
>> > some feedback before looking into spec.
>> > tab method bodies
>> > then do not use instance variables with uppercase.
>> >
>> > Stef
>> >
>> >
>> > On Sun, Mar 4, 2018 at 2:26 PM, Yuriy Babah <[hidden email]>
>> > wrote:
>> >> changed
>> >>
>> >> 2018-03-04 16:20 GMT+03:00 Yuriy Babah <[hidden email]>:
>> >>>
>> >>> Is it enough if I just attach it?
>> >>>
>> >>> I slightly changed the code, that leads to error: "DoesNotUndestand
>> >>> #plaintiffsTextInput" .
>> >>>
>> >>> Now I'm studying Help on Spec in SystemBrowser .
>> >>>
>> >>>
>> >>>
>> >>> 2018-03-04 15:23 GMT+03:00 Stephane Ducasse <[hidden email]>:
>> >>>>
>> >>>> Hi Yuriy
>> >>>>
>> >>>> this is difficult to debug remotely. Do you have your code somewhere?
>> >>>>
>> >>>> Stef
>> >>>>
>> >>>> On Sat, Mar 3, 2018 at 8:41 AM, Yuriy Babah <[hidden email]>
>> >>>> wrote:
>> >>>> > Hi!
>> >>>> > I'm trying to write GUI element with Spec, Pharo6.1x64 on Linux.
>> >>>> > Do according to the SpecBooklet.
>> >>>> >
>> >>>> > Finished the fragment, and try do:
>> >>>> >
>> >>>> > ui := GUI_ListCourtCase new openWithSpec . -> #value was sent to
>> >>>> > nil.
>> >>>> >
>> >>>> > I look in a debugger and:
>> >>>> >
>> >>>> > openWithSpecLayout: aSpec
>> >>>> >     "Build the widget using the spec name provided as argument and
>> >>>> > display
>> >>>> > it into a window"
>> >>>> >
>> >>>> >     (window value notNil and: [ self needRebuild not ])
>> >>>> >         ifTrue: [ "window != nil"
>> >>>> >             window value rebuildWithSpecLayout: aSpec ]
>> >>>> >         ifFalse: [  "If value = Nil   --> send him a message ???"
>> >>>> >             window value: (self defaultWindowModelClass new model:
>> >>>> > self).
>> >>>> >             window value openWithSpecLayout: aSpec.
>> >>>> >             self takeKeyboardFocus ].
>> >>>> >
>> >>>> >     ^ window value
>> >>>>
>> >>>
>> >>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: my mistake on Spec?

Yuriy Babah
yesterday i did it, and got  -->  doesNotUndestand #layout

2018-03-05 20:28 GMT+03:00 Stephane Ducasse <[hidden email]>:
First implement all the missing methods that you use in the spec class method.
Then let us know.

Stef


On Sun, Mar 4, 2018 at 2:56 PM, Yuriy Babah <[hidden email]> wrote:
> Thanks for your help, Stef.
> Mistakes remain, but I will try to understand them
>
> 2018-03-04 16:35 GMT+03:00 Stephane Ducasse <[hidden email]>:
>>
>> I'm doing a pass on your code
>>
>> OrderedCollection new is better to me than #() asOrderedCollection.
>>
>> GUI_ListCourtCase new openWithSpec
>> => DNU
>> So I added the first missing method, but you should define the
>> corresponding methods in the class.
>>
>>
>>
>>
>>
>>
>>
>> On Sun, Mar 4, 2018 at 2:28 PM, Stephane Ducasse
>> <[hidden email]> wrote:
>> > Hi yuri
>> >
>> > some feedback before looking into spec.
>> > tab method bodies
>> > then do not use instance variables with uppercase.
>> >
>> > Stef
>> >
>> >
>> > On Sun, Mar 4, 2018 at 2:26 PM, Yuriy Babah <[hidden email]>
>> > wrote:
>> >> changed
>> >>
>> >> 2018-03-04 16:20 GMT+03:00 Yuriy Babah <[hidden email]>:
>> >>>
>> >>> Is it enough if I just attach it?
>> >>>
>> >>> I slightly changed the code, that leads to error: "DoesNotUndestand
>> >>> #plaintiffsTextInput" .
>> >>>
>> >>> Now I'm studying Help on Spec in SystemBrowser .
>> >>>
>> >>>
>> >>>
>> >>> 2018-03-04 15:23 GMT+03:00 Stephane Ducasse <[hidden email]>:
>> >>>>
>> >>>> Hi Yuriy
>> >>>>
>> >>>> this is difficult to debug remotely. Do you have your code somewhere?
>> >>>>
>> >>>> Stef
>> >>>>
>> >>>> On Sat, Mar 3, 2018 at 8:41 AM, Yuriy Babah <[hidden email]>
>> >>>> wrote:
>> >>>> > Hi!
>> >>>> > I'm trying to write GUI element with Spec, Pharo6.1x64 on Linux.
>> >>>> > Do according to the SpecBooklet.
>> >>>> >
>> >>>> > Finished the fragment, and try do:
>> >>>> >
>> >>>> > ui := GUI_ListCourtCase new openWithSpec . -> #value was sent to
>> >>>> > nil.
>> >>>> >
>> >>>> > I look in a debugger and:
>> >>>> >
>> >>>> > openWithSpecLayout: aSpec
>> >>>> >     "Build the widget using the spec name provided as argument and
>> >>>> > display
>> >>>> > it into a window"
>> >>>> >
>> >>>> >     (window value notNil and: [ self needRebuild not ])
>> >>>> >         ifTrue: [ "window != nil"
>> >>>> >             window value rebuildWithSpecLayout: aSpec ]
>> >>>> >         ifFalse: [  "If value = Nil   --> send him a message ???"
>> >>>> >             window value: (self defaultWindowModelClass new model:
>> >>>> > self).
>> >>>> >             window value openWithSpecLayout: aSpec.
>> >>>> >             self takeKeyboardFocus ].
>> >>>> >
>> >>>> >     ^ window value
>> >>>>
>> >>>
>> >>
>
>



LegalBasis.st (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: my mistake on Spec?

Stephane Ducasse-3
I'm trying to understand.
I do not get a DNU with the following. You cannot put row out of nowhere.

defaultSpec
^ SpecLayout composed
          newColumn: [ :col |
            col
                newRow: [ :row |
                                      row
                                       add: #plaintiffsTextInput;
                                       add: #addButtonPlaintiffs ];
              newRow: [ :row |
                 row
                     add: #defendantsTextInput;
                     add: #addButtonDefendants ];
             newRow: [ :row |
                 row
                     add: #thirdPartiesTextInput;
                     add: #addButtonThirdParties ] ];
yourself

Now I do not understand why when I add the next lines I get an error








On Mon, Mar 5, 2018 at 7:03 PM, Yuriy Babah <[hidden email]> wrote:

> yesterday i did it, and got  -->  doesNotUndestand #layout
>
> 2018-03-05 20:28 GMT+03:00 Stephane Ducasse <[hidden email]>:
>>
>> First implement all the missing methods that you use in the spec class
>> method.
>> Then let us know.
>>
>> Stef
>>
>>
>> On Sun, Mar 4, 2018 at 2:56 PM, Yuriy Babah <[hidden email]>
>> wrote:
>> > Thanks for your help, Stef.
>> > Mistakes remain, but I will try to understand them
>> >
>> > 2018-03-04 16:35 GMT+03:00 Stephane Ducasse <[hidden email]>:
>> >>
>> >> I'm doing a pass on your code
>> >>
>> >> OrderedCollection new is better to me than #() asOrderedCollection.
>> >>
>> >> GUI_ListCourtCase new openWithSpec
>> >> => DNU
>> >> So I added the first missing method, but you should define the
>> >> corresponding methods in the class.
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> On Sun, Mar 4, 2018 at 2:28 PM, Stephane Ducasse
>> >> <[hidden email]> wrote:
>> >> > Hi yuri
>> >> >
>> >> > some feedback before looking into spec.
>> >> > tab method bodies
>> >> > then do not use instance variables with uppercase.
>> >> >
>> >> > Stef
>> >> >
>> >> >
>> >> > On Sun, Mar 4, 2018 at 2:26 PM, Yuriy Babah <[hidden email]>
>> >> > wrote:
>> >> >> changed
>> >> >>
>> >> >> 2018-03-04 16:20 GMT+03:00 Yuriy Babah <[hidden email]>:
>> >> >>>
>> >> >>> Is it enough if I just attach it?
>> >> >>>
>> >> >>> I slightly changed the code, that leads to error: "DoesNotUndestand
>> >> >>> #plaintiffsTextInput" .
>> >> >>>
>> >> >>> Now I'm studying Help on Spec in SystemBrowser .
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>> 2018-03-04 15:23 GMT+03:00 Stephane Ducasse
>> >> >>> <[hidden email]>:
>> >> >>>>
>> >> >>>> Hi Yuriy
>> >> >>>>
>> >> >>>> this is difficult to debug remotely. Do you have your code
>> >> >>>> somewhere?
>> >> >>>>
>> >> >>>> Stef
>> >> >>>>
>> >> >>>> On Sat, Mar 3, 2018 at 8:41 AM, Yuriy Babah
>> >> >>>> <[hidden email]>
>> >> >>>> wrote:
>> >> >>>> > Hi!
>> >> >>>> > I'm trying to write GUI element with Spec, Pharo6.1x64 on Linux.
>> >> >>>> > Do according to the SpecBooklet.
>> >> >>>> >
>> >> >>>> > Finished the fragment, and try do:
>> >> >>>> >
>> >> >>>> > ui := GUI_ListCourtCase new openWithSpec . -> #value was sent to
>> >> >>>> > nil.
>> >> >>>> >
>> >> >>>> > I look in a debugger and:
>> >> >>>> >
>> >> >>>> > openWithSpecLayout: aSpec
>> >> >>>> >     "Build the widget using the spec name provided as argument
>> >> >>>> > and
>> >> >>>> > display
>> >> >>>> > it into a window"
>> >> >>>> >
>> >> >>>> >     (window value notNil and: [ self needRebuild not ])
>> >> >>>> >         ifTrue: [ "window != nil"
>> >> >>>> >             window value rebuildWithSpecLayout: aSpec ]
>> >> >>>> >         ifFalse: [  "If value = Nil   --> send him a message
>> >> >>>> > ???"
>> >> >>>> >             window value: (self defaultWindowModelClass new
>> >> >>>> > model:
>> >> >>>> > self).
>> >> >>>> >             window value openWithSpecLayout: aSpec.
>> >> >>>> >             self takeKeyboardFocus ].
>> >> >>>> >
>> >> >>>> >     ^ window value
>> >> >>>>
>> >> >>>
>> >> >>
>> >
>> >
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: my mistake on Spec?

Stephane Ducasse-3
defaultSpec2
<spec: #default>
^ SpecLayout composed
newColumn: [ :col |
col
newRow: [ :row |
row
add: #plaintiffsTextInput;
add: #addButtonPlaintiffs ];
newRow: [ :row |
row
add: #defendantsTextInput;
add: #addButtonDefendants ];
newRow: [ :row |
row
add: #thirdPartiesTextInput;
add: #addButtonThirdParties ];
newRow: [ :row | row add: #addButtonCourtCase ] ];
yourself

is working






On Mon, Mar 5, 2018 at 9:00 PM, Stephane Ducasse
<[hidden email]> wrote:

> I'm trying to understand.
> I do not get a DNU with the following. You cannot put row out of nowhere.
>
> defaultSpec
> ^ SpecLayout composed
>           newColumn: [ :col |
>             col
>                 newRow: [ :row |
>                                       row
>                                        add: #plaintiffsTextInput;
>                                        add: #addButtonPlaintiffs ];
>               newRow: [ :row |
>                  row
>                      add: #defendantsTextInput;
>                      add: #addButtonDefendants ];
>              newRow: [ :row |
>                  row
>                      add: #thirdPartiesTextInput;
>                      add: #addButtonThirdParties ] ];
> yourself
>
> Now I do not understand why when I add the next lines I get an error
>
>
>
>
>
>
>
>
> On Mon, Mar 5, 2018 at 7:03 PM, Yuriy Babah <[hidden email]> wrote:
>> yesterday i did it, and got  -->  doesNotUndestand #layout
>>
>> 2018-03-05 20:28 GMT+03:00 Stephane Ducasse <[hidden email]>:
>>>
>>> First implement all the missing methods that you use in the spec class
>>> method.
>>> Then let us know.
>>>
>>> Stef
>>>
>>>
>>> On Sun, Mar 4, 2018 at 2:56 PM, Yuriy Babah <[hidden email]>
>>> wrote:
>>> > Thanks for your help, Stef.
>>> > Mistakes remain, but I will try to understand them
>>> >
>>> > 2018-03-04 16:35 GMT+03:00 Stephane Ducasse <[hidden email]>:
>>> >>
>>> >> I'm doing a pass on your code
>>> >>
>>> >> OrderedCollection new is better to me than #() asOrderedCollection.
>>> >>
>>> >> GUI_ListCourtCase new openWithSpec
>>> >> => DNU
>>> >> So I added the first missing method, but you should define the
>>> >> corresponding methods in the class.
>>> >>
>>> >>
>>> >>
>>> >>
>>> >>
>>> >>
>>> >>
>>> >> On Sun, Mar 4, 2018 at 2:28 PM, Stephane Ducasse
>>> >> <[hidden email]> wrote:
>>> >> > Hi yuri
>>> >> >
>>> >> > some feedback before looking into spec.
>>> >> > tab method bodies
>>> >> > then do not use instance variables with uppercase.
>>> >> >
>>> >> > Stef
>>> >> >
>>> >> >
>>> >> > On Sun, Mar 4, 2018 at 2:26 PM, Yuriy Babah <[hidden email]>
>>> >> > wrote:
>>> >> >> changed
>>> >> >>
>>> >> >> 2018-03-04 16:20 GMT+03:00 Yuriy Babah <[hidden email]>:
>>> >> >>>
>>> >> >>> Is it enough if I just attach it?
>>> >> >>>
>>> >> >>> I slightly changed the code, that leads to error: "DoesNotUndestand
>>> >> >>> #plaintiffsTextInput" .
>>> >> >>>
>>> >> >>> Now I'm studying Help on Spec in SystemBrowser .
>>> >> >>>
>>> >> >>>
>>> >> >>>
>>> >> >>> 2018-03-04 15:23 GMT+03:00 Stephane Ducasse
>>> >> >>> <[hidden email]>:
>>> >> >>>>
>>> >> >>>> Hi Yuriy
>>> >> >>>>
>>> >> >>>> this is difficult to debug remotely. Do you have your code
>>> >> >>>> somewhere?
>>> >> >>>>
>>> >> >>>> Stef
>>> >> >>>>
>>> >> >>>> On Sat, Mar 3, 2018 at 8:41 AM, Yuriy Babah
>>> >> >>>> <[hidden email]>
>>> >> >>>> wrote:
>>> >> >>>> > Hi!
>>> >> >>>> > I'm trying to write GUI element with Spec, Pharo6.1x64 on Linux.
>>> >> >>>> > Do according to the SpecBooklet.
>>> >> >>>> >
>>> >> >>>> > Finished the fragment, and try do:
>>> >> >>>> >
>>> >> >>>> > ui := GUI_ListCourtCase new openWithSpec . -> #value was sent to
>>> >> >>>> > nil.
>>> >> >>>> >
>>> >> >>>> > I look in a debugger and:
>>> >> >>>> >
>>> >> >>>> > openWithSpecLayout: aSpec
>>> >> >>>> >     "Build the widget using the spec name provided as argument
>>> >> >>>> > and
>>> >> >>>> > display
>>> >> >>>> > it into a window"
>>> >> >>>> >
>>> >> >>>> >     (window value notNil and: [ self needRebuild not ])
>>> >> >>>> >         ifTrue: [ "window != nil"
>>> >> >>>> >             window value rebuildWithSpecLayout: aSpec ]
>>> >> >>>> >         ifFalse: [  "If value = Nil   --> send him a message
>>> >> >>>> > ???"
>>> >> >>>> >             window value: (self defaultWindowModelClass new
>>> >> >>>> > model:
>>> >> >>>> > self).
>>> >> >>>> >             window value openWithSpecLayout: aSpec.
>>> >> >>>> >             self takeKeyboardFocus ].
>>> >> >>>> >
>>> >> >>>> >     ^ window value
>>> >> >>>>
>>> >> >>>
>>> >> >>
>>> >
>>> >
>>>
>>

Screen Shot 2018-03-05 at 21.08.15.png (37K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: my mistake on Spec?

Stephane Ducasse-3
You should initialize the instance variable

#subjectTextInput

I suggest to do your UI incrementally.

Stef

On Mon, Mar 5, 2018 at 9:08 PM, Stephane Ducasse
<[hidden email]> wrote:

> defaultSpec2
> <spec: #default>
> ^ SpecLayout composed
> newColumn: [ :col |
> col
> newRow: [ :row |
> row
> add: #plaintiffsTextInput;
> add: #addButtonPlaintiffs ];
> newRow: [ :row |
> row
> add: #defendantsTextInput;
> add: #addButtonDefendants ];
> newRow: [ :row |
> row
> add: #thirdPartiesTextInput;
> add: #addButtonThirdParties ];
> newRow: [ :row | row add: #addButtonCourtCase ] ];
> yourself
>
> is working
>
>
>
>
>
>
> On Mon, Mar 5, 2018 at 9:00 PM, Stephane Ducasse
> <[hidden email]> wrote:
>> I'm trying to understand.
>> I do not get a DNU with the following. You cannot put row out of nowhere.
>>
>> defaultSpec
>> ^ SpecLayout composed
>>           newColumn: [ :col |
>>             col
>>                 newRow: [ :row |
>>                                       row
>>                                        add: #plaintiffsTextInput;
>>                                        add: #addButtonPlaintiffs ];
>>               newRow: [ :row |
>>                  row
>>                      add: #defendantsTextInput;
>>                      add: #addButtonDefendants ];
>>              newRow: [ :row |
>>                  row
>>                      add: #thirdPartiesTextInput;
>>                      add: #addButtonThirdParties ] ];
>> yourself
>>
>> Now I do not understand why when I add the next lines I get an error
>>
>>
>>
>>
>>
>>
>>
>>
>> On Mon, Mar 5, 2018 at 7:03 PM, Yuriy Babah <[hidden email]> wrote:
>>> yesterday i did it, and got  -->  doesNotUndestand #layout
>>>
>>> 2018-03-05 20:28 GMT+03:00 Stephane Ducasse <[hidden email]>:
>>>>
>>>> First implement all the missing methods that you use in the spec class
>>>> method.
>>>> Then let us know.
>>>>
>>>> Stef
>>>>
>>>>
>>>> On Sun, Mar 4, 2018 at 2:56 PM, Yuriy Babah <[hidden email]>
>>>> wrote:
>>>> > Thanks for your help, Stef.
>>>> > Mistakes remain, but I will try to understand them
>>>> >
>>>> > 2018-03-04 16:35 GMT+03:00 Stephane Ducasse <[hidden email]>:
>>>> >>
>>>> >> I'm doing a pass on your code
>>>> >>
>>>> >> OrderedCollection new is better to me than #() asOrderedCollection.
>>>> >>
>>>> >> GUI_ListCourtCase new openWithSpec
>>>> >> => DNU
>>>> >> So I added the first missing method, but you should define the
>>>> >> corresponding methods in the class.
>>>> >>
>>>> >>
>>>> >>
>>>> >>
>>>> >>
>>>> >>
>>>> >>
>>>> >> On Sun, Mar 4, 2018 at 2:28 PM, Stephane Ducasse
>>>> >> <[hidden email]> wrote:
>>>> >> > Hi yuri
>>>> >> >
>>>> >> > some feedback before looking into spec.
>>>> >> > tab method bodies
>>>> >> > then do not use instance variables with uppercase.
>>>> >> >
>>>> >> > Stef
>>>> >> >
>>>> >> >
>>>> >> > On Sun, Mar 4, 2018 at 2:26 PM, Yuriy Babah <[hidden email]>
>>>> >> > wrote:
>>>> >> >> changed
>>>> >> >>
>>>> >> >> 2018-03-04 16:20 GMT+03:00 Yuriy Babah <[hidden email]>:
>>>> >> >>>
>>>> >> >>> Is it enough if I just attach it?
>>>> >> >>>
>>>> >> >>> I slightly changed the code, that leads to error: "DoesNotUndestand
>>>> >> >>> #plaintiffsTextInput" .
>>>> >> >>>
>>>> >> >>> Now I'm studying Help on Spec in SystemBrowser .
>>>> >> >>>
>>>> >> >>>
>>>> >> >>>
>>>> >> >>> 2018-03-04 15:23 GMT+03:00 Stephane Ducasse
>>>> >> >>> <[hidden email]>:
>>>> >> >>>>
>>>> >> >>>> Hi Yuriy
>>>> >> >>>>
>>>> >> >>>> this is difficult to debug remotely. Do you have your code
>>>> >> >>>> somewhere?
>>>> >> >>>>
>>>> >> >>>> Stef
>>>> >> >>>>
>>>> >> >>>> On Sat, Mar 3, 2018 at 8:41 AM, Yuriy Babah
>>>> >> >>>> <[hidden email]>
>>>> >> >>>> wrote:
>>>> >> >>>> > Hi!
>>>> >> >>>> > I'm trying to write GUI element with Spec, Pharo6.1x64 on Linux.
>>>> >> >>>> > Do according to the SpecBooklet.
>>>> >> >>>> >
>>>> >> >>>> > Finished the fragment, and try do:
>>>> >> >>>> >
>>>> >> >>>> > ui := GUI_ListCourtCase new openWithSpec . -> #value was sent to
>>>> >> >>>> > nil.
>>>> >> >>>> >
>>>> >> >>>> > I look in a debugger and:
>>>> >> >>>> >
>>>> >> >>>> > openWithSpecLayout: aSpec
>>>> >> >>>> >     "Build the widget using the spec name provided as argument
>>>> >> >>>> > and
>>>> >> >>>> > display
>>>> >> >>>> > it into a window"
>>>> >> >>>> >
>>>> >> >>>> >     (window value notNil and: [ self needRebuild not ])
>>>> >> >>>> >         ifTrue: [ "window != nil"
>>>> >> >>>> >             window value rebuildWithSpecLayout: aSpec ]
>>>> >> >>>> >         ifFalse: [  "If value = Nil   --> send him a message
>>>> >> >>>> > ???"
>>>> >> >>>> >             window value: (self defaultWindowModelClass new
>>>> >> >>>> > model:
>>>> >> >>>> > self).
>>>> >> >>>> >             window value openWithSpecLayout: aSpec.
>>>> >> >>>> >             self takeKeyboardFocus ].
>>>> >> >>>> >
>>>> >> >>>> >     ^ window value
>>>> >> >>>>
>>>> >> >>>
>>>> >> >>
>>>> >
>>>> >
>>>>
>>>

Reply | Threaded
Open this post in threaded view
|

Re: my mistake on Spec?

Yuriy Babah
Yes, i'm undestand. Looks good now.




2018-03-05 23:10 GMT+03:00 Stephane Ducasse <[hidden email]>:
You should initialize the instance variable

#subjectTextInput

I suggest to do your UI incrementally.

Stef

On Mon, Mar 5, 2018 at 9:08 PM, Stephane Ducasse
<[hidden email]> wrote:
> defaultSpec2
> <spec: #default>
> ^ SpecLayout composed
> newColumn: [ :col |
> col
> newRow: [ :row |
> row
> add: #plaintiffsTextInput;
> add: #addButtonPlaintiffs ];
> newRow: [ :row |
> row
> add: #defendantsTextInput;
> add: #addButtonDefendants ];
> newRow: [ :row |
> row
> add: #thirdPartiesTextInput;
> add: #addButtonThirdParties ];
> newRow: [ :row | row add: #addButtonCourtCase ] ];
> yourself
>
> is working
>
>
>
>
>
>
> On Mon, Mar 5, 2018 at 9:00 PM, Stephane Ducasse
> <[hidden email]> wrote:
>> I'm trying to understand.
>> I do not get a DNU with the following. You cannot put row out of nowhere.
>>
>> defaultSpec
>> ^ SpecLayout composed
>>           newColumn: [ :col |
>>             col
>>                 newRow: [ :row |
>>                                       row
>>                                        add: #plaintiffsTextInput;
>>                                        add: #addButtonPlaintiffs ];
>>               newRow: [ :row |
>>                  row
>>                      add: #defendantsTextInput;
>>                      add: #addButtonDefendants ];
>>              newRow: [ :row |
>>                  row
>>                      add: #thirdPartiesTextInput;
>>                      add: #addButtonThirdParties ] ];
>> yourself
>>
>> Now I do not understand why when I add the next lines I get an error
>>
>>
>>
>>
>>
>>
>>
>>
>> On Mon, Mar 5, 2018 at 7:03 PM, Yuriy Babah <[hidden email]> wrote:
>>> yesterday i did it, and got  -->  doesNotUndestand #layout
>>>
>>> 2018-03-05 20:28 GMT+03:00 Stephane Ducasse <[hidden email]>:
>>>>
>>>> First implement all the missing methods that you use in the spec class
>>>> method.
>>>> Then let us know.
>>>>
>>>> Stef
>>>>
>>>>
>>>> On Sun, Mar 4, 2018 at 2:56 PM, Yuriy Babah <[hidden email]>
>>>> wrote:
>>>> > Thanks for your help, Stef.
>>>> > Mistakes remain, but I will try to understand them
>>>> >
>>>> > 2018-03-04 16:35 GMT+03:00 Stephane Ducasse <[hidden email]>:
>>>> >>
>>>> >> I'm doing a pass on your code
>>>> >>
>>>> >> OrderedCollection new is better to me than #() asOrderedCollection.
>>>> >>
>>>> >> GUI_ListCourtCase new openWithSpec
>>>> >> => DNU
>>>> >> So I added the first missing method, but you should define the
>>>> >> corresponding methods in the class.
>>>> >>
>>>> >>
>>>> >>
>>>> >>
>>>> >>
>>>> >>
>>>> >>
>>>> >> On Sun, Mar 4, 2018 at 2:28 PM, Stephane Ducasse
>>>> >> <[hidden email]> wrote:
>>>> >> > Hi yuri
>>>> >> >
>>>> >> > some feedback before looking into spec.
>>>> >> > tab method bodies
>>>> >> > then do not use instance variables with uppercase.
>>>> >> >
>>>> >> > Stef
>>>> >> >
>>>> >> >
>>>> >> > On Sun, Mar 4, 2018 at 2:26 PM, Yuriy Babah <[hidden email]>
>>>> >> > wrote:
>>>> >> >> changed
>>>> >> >>
>>>> >> >> 2018-03-04 16:20 GMT+03:00 Yuriy Babah <[hidden email]>:
>>>> >> >>>
>>>> >> >>> Is it enough if I just attach it?
>>>> >> >>>
>>>> >> >>> I slightly changed the code, that leads to error: "DoesNotUndestand
>>>> >> >>> #plaintiffsTextInput" .
>>>> >> >>>
>>>> >> >>> Now I'm studying Help on Spec in SystemBrowser .
>>>> >> >>>
>>>> >> >>>
>>>> >> >>>
>>>> >> >>> 2018-03-04 15:23 GMT+03:00 Stephane Ducasse
>>>> >> >>> <[hidden email]>:
>>>> >> >>>>
>>>> >> >>>> Hi Yuriy
>>>> >> >>>>
>>>> >> >>>> this is difficult to debug remotely. Do you have your code
>>>> >> >>>> somewhere?
>>>> >> >>>>
>>>> >> >>>> Stef
>>>> >> >>>>
>>>> >> >>>> On Sat, Mar 3, 2018 at 8:41 AM, Yuriy Babah
>>>> >> >>>> <[hidden email]>
>>>> >> >>>> wrote:
>>>> >> >>>> > Hi!
>>>> >> >>>> > I'm trying to write GUI element with Spec, Pharo6.1x64 on Linux.
>>>> >> >>>> > Do according to the SpecBooklet.
>>>> >> >>>> >
>>>> >> >>>> > Finished the fragment, and try do:
>>>> >> >>>> >
>>>> >> >>>> > ui := GUI_ListCourtCase new openWithSpec . -> #value was sent to
>>>> >> >>>> > nil.
>>>> >> >>>> >
>>>> >> >>>> > I look in a debugger and:
>>>> >> >>>> >
>>>> >> >>>> > openWithSpecLayout: aSpec
>>>> >> >>>> >     "Build the widget using the spec name provided as argument
>>>> >> >>>> > and
>>>> >> >>>> > display
>>>> >> >>>> > it into a window"
>>>> >> >>>> >
>>>> >> >>>> >     (window value notNil and: [ self needRebuild not ])
>>>> >> >>>> >         ifTrue: [ "window != nil"
>>>> >> >>>> >             window value rebuildWithSpecLayout: aSpec ]
>>>> >> >>>> >         ifFalse: [  "If value = Nil   --> send him a message
>>>> >> >>>> > ???"
>>>> >> >>>> >             window value: (self defaultWindowModelClass new
>>>> >> >>>> > model:
>>>> >> >>>> > self).
>>>> >> >>>> >             window value openWithSpecLayout: aSpec.
>>>> >> >>>> >             self takeKeyboardFocus ].
>>>> >> >>>> >
>>>> >> >>>> >     ^ window value
>>>> >> >>>>
>>>> >> >>>
>>>> >> >>
>>>> >
>>>> >
>>>>
>>>



PharoScreenshot.png (26K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: my mistake on Spec?

Stephane Ducasse-3
I'm happy
Let us know about your project! And if you need I can do a code review.

Stef

On Tue, Mar 6, 2018 at 1:36 PM, Yuriy Babah <[hidden email]> wrote:

> Yes, i'm undestand. Looks good now.
>
>
>
>
> 2018-03-05 23:10 GMT+03:00 Stephane Ducasse <[hidden email]>:
>>
>> You should initialize the instance variable
>>
>> #subjectTextInput
>>
>> I suggest to do your UI incrementally.
>>
>> Stef
>>
>> On Mon, Mar 5, 2018 at 9:08 PM, Stephane Ducasse
>> <[hidden email]> wrote:
>> > defaultSpec2
>> > <spec: #default>
>> > ^ SpecLayout composed
>> > newColumn: [ :col |
>> > col
>> > newRow: [ :row |
>> > row
>> > add: #plaintiffsTextInput;
>> > add: #addButtonPlaintiffs ];
>> > newRow: [ :row |
>> > row
>> > add: #defendantsTextInput;
>> > add: #addButtonDefendants ];
>> > newRow: [ :row |
>> > row
>> > add: #thirdPartiesTextInput;
>> > add: #addButtonThirdParties ];
>> > newRow: [ :row | row add: #addButtonCourtCase ] ];
>> > yourself
>> >
>> > is working
>> >
>> >
>> >
>> >
>> >
>> >
>> > On Mon, Mar 5, 2018 at 9:00 PM, Stephane Ducasse
>> > <[hidden email]> wrote:
>> >> I'm trying to understand.
>> >> I do not get a DNU with the following. You cannot put row out of
>> >> nowhere.
>> >>
>> >> defaultSpec
>> >> ^ SpecLayout composed
>> >>           newColumn: [ :col |
>> >>             col
>> >>                 newRow: [ :row |
>> >>                                       row
>> >>                                        add: #plaintiffsTextInput;
>> >>                                        add: #addButtonPlaintiffs ];
>> >>               newRow: [ :row |
>> >>                  row
>> >>                      add: #defendantsTextInput;
>> >>                      add: #addButtonDefendants ];
>> >>              newRow: [ :row |
>> >>                  row
>> >>                      add: #thirdPartiesTextInput;
>> >>                      add: #addButtonThirdParties ] ];
>> >> yourself
>> >>
>> >> Now I do not understand why when I add the next lines I get an error
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> On Mon, Mar 5, 2018 at 7:03 PM, Yuriy Babah <[hidden email]>
>> >> wrote:
>> >>> yesterday i did it, and got  -->  doesNotUndestand #layout
>> >>>
>> >>> 2018-03-05 20:28 GMT+03:00 Stephane Ducasse <[hidden email]>:
>> >>>>
>> >>>> First implement all the missing methods that you use in the spec
>> >>>> class
>> >>>> method.
>> >>>> Then let us know.
>> >>>>
>> >>>> Stef
>> >>>>
>> >>>>
>> >>>> On Sun, Mar 4, 2018 at 2:56 PM, Yuriy Babah <[hidden email]>
>> >>>> wrote:
>> >>>> > Thanks for your help, Stef.
>> >>>> > Mistakes remain, but I will try to understand them
>> >>>> >
>> >>>> > 2018-03-04 16:35 GMT+03:00 Stephane Ducasse
>> >>>> > <[hidden email]>:
>> >>>> >>
>> >>>> >> I'm doing a pass on your code
>> >>>> >>
>> >>>> >> OrderedCollection new is better to me than #()
>> >>>> >> asOrderedCollection.
>> >>>> >>
>> >>>> >> GUI_ListCourtCase new openWithSpec
>> >>>> >> => DNU
>> >>>> >> So I added the first missing method, but you should define the
>> >>>> >> corresponding methods in the class.
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >> On Sun, Mar 4, 2018 at 2:28 PM, Stephane Ducasse
>> >>>> >> <[hidden email]> wrote:
>> >>>> >> > Hi yuri
>> >>>> >> >
>> >>>> >> > some feedback before looking into spec.
>> >>>> >> > tab method bodies
>> >>>> >> > then do not use instance variables with uppercase.
>> >>>> >> >
>> >>>> >> > Stef
>> >>>> >> >
>> >>>> >> >
>> >>>> >> > On Sun, Mar 4, 2018 at 2:26 PM, Yuriy Babah
>> >>>> >> > <[hidden email]>
>> >>>> >> > wrote:
>> >>>> >> >> changed
>> >>>> >> >>
>> >>>> >> >> 2018-03-04 16:20 GMT+03:00 Yuriy Babah
>> >>>> >> >> <[hidden email]>:
>> >>>> >> >>>
>> >>>> >> >>> Is it enough if I just attach it?
>> >>>> >> >>>
>> >>>> >> >>> I slightly changed the code, that leads to error:
>> >>>> >> >>> "DoesNotUndestand
>> >>>> >> >>> #plaintiffsTextInput" .
>> >>>> >> >>>
>> >>>> >> >>> Now I'm studying Help on Spec in SystemBrowser .
>> >>>> >> >>>
>> >>>> >> >>>
>> >>>> >> >>>
>> >>>> >> >>> 2018-03-04 15:23 GMT+03:00 Stephane Ducasse
>> >>>> >> >>> <[hidden email]>:
>> >>>> >> >>>>
>> >>>> >> >>>> Hi Yuriy
>> >>>> >> >>>>
>> >>>> >> >>>> this is difficult to debug remotely. Do you have your code
>> >>>> >> >>>> somewhere?
>> >>>> >> >>>>
>> >>>> >> >>>> Stef
>> >>>> >> >>>>
>> >>>> >> >>>> On Sat, Mar 3, 2018 at 8:41 AM, Yuriy Babah
>> >>>> >> >>>> <[hidden email]>
>> >>>> >> >>>> wrote:
>> >>>> >> >>>> > Hi!
>> >>>> >> >>>> > I'm trying to write GUI element with Spec, Pharo6.1x64 on
>> >>>> >> >>>> > Linux.
>> >>>> >> >>>> > Do according to the SpecBooklet.
>> >>>> >> >>>> >
>> >>>> >> >>>> > Finished the fragment, and try do:
>> >>>> >> >>>> >
>> >>>> >> >>>> > ui := GUI_ListCourtCase new openWithSpec . -> #value was
>> >>>> >> >>>> > sent to
>> >>>> >> >>>> > nil.
>> >>>> >> >>>> >
>> >>>> >> >>>> > I look in a debugger and:
>> >>>> >> >>>> >
>> >>>> >> >>>> > openWithSpecLayout: aSpec
>> >>>> >> >>>> >     "Build the widget using the spec name provided as
>> >>>> >> >>>> > argument
>> >>>> >> >>>> > and
>> >>>> >> >>>> > display
>> >>>> >> >>>> > it into a window"
>> >>>> >> >>>> >
>> >>>> >> >>>> >     (window value notNil and: [ self needRebuild not ])
>> >>>> >> >>>> >         ifTrue: [ "window != nil"
>> >>>> >> >>>> >             window value rebuildWithSpecLayout: aSpec ]
>> >>>> >> >>>> >         ifFalse: [  "If value = Nil   --> send him a
>> >>>> >> >>>> > message
>> >>>> >> >>>> > ???"
>> >>>> >> >>>> >             window value: (self defaultWindowModelClass new
>> >>>> >> >>>> > model:
>> >>>> >> >>>> > self).
>> >>>> >> >>>> >             window value openWithSpecLayout: aSpec.
>> >>>> >> >>>> >             self takeKeyboardFocus ].
>> >>>> >> >>>> >
>> >>>> >> >>>> >     ^ window value
>> >>>> >> >>>>
>> >>>> >> >>>
>> >>>> >> >>
>> >>>> >
>> >>>> >
>> >>>>
>> >>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: my mistake on Spec?

Yuriy Babah
i'm very pleased to!
Generally, I'm not a professional programmer. I'm a builder-designer.
Аlthough I have been interested in programming for a long time. Аnd sometimes I use it.
Faro is very elegant, he has a cool debugger and an inspector, in my opinion.
Well, you yourself probably know this.
I do my home project in my spare time, very slowly. Because of the large amount of basic work now.
I want to sort out a bunch of court cases of relatives and related information. Although, probably, some third-party service would make it much easier.
Probably, it's more just learning Faro and Spec.
Now there are questions how to associate my ComposableModel subclass and a regular class with my code.
When I do so "l: = GUI_ListCourtCase new openWithSpec: # defaultSpec2." and  try to look at the variable l, I do not see an instance variable that is not related to widgets.
I'm trying to initialize it in initializeWidjets, because when I create the method "initialize", I get an error.
Worst of all, that i'm not able be in time to investigate the emerging issues myself by the time I get the answers.
I do not want to make you think that I'm trying to get you to do my job )))
I can formulate my questions a little later))


2018-03-07 17:41 GMT+03:00 Stephane Ducasse <[hidden email]>:
I'm happy
Let us know about your project! And if you need I can do a code review.

Stef

On Tue, Mar 6, 2018 at 1:36 PM, Yuriy Babah <[hidden email]> wrote:
> Yes, i'm undestand. Looks good now.
>
>
>
>
> 2018-03-05 23:10 GMT+03:00 Stephane Ducasse <[hidden email]>:
>>
>> You should initialize the instance variable
>>
>> #subjectTextInput
>>
>> I suggest to do your UI incrementally.
>>
>> Stef
>>
>> On Mon, Mar 5, 2018 at 9:08 PM, Stephane Ducasse
>> <[hidden email]> wrote:
>> > defaultSpec2
>> > <spec: #default>
>> > ^ SpecLayout composed
>> > newColumn: [ :col |
>> > col
>> > newRow: [ :row |
>> > row
>> > add: #plaintiffsTextInput;
>> > add: #addButtonPlaintiffs ];
>> > newRow: [ :row |
>> > row
>> > add: #defendantsTextInput;
>> > add: #addButtonDefendants ];
>> > newRow: [ :row |
>> > row
>> > add: #thirdPartiesTextInput;
>> > add: #addButtonThirdParties ];
>> > newRow: [ :row | row add: #addButtonCourtCase ] ];
>> > yourself
>> >
>> > is working
>> >
>> >
>> >
>> >
>> >
>> >
>> > On Mon, Mar 5, 2018 at 9:00 PM, Stephane Ducasse
>> > <[hidden email]> wrote:
>> >> I'm trying to understand.
>> >> I do not get a DNU with the following. You cannot put row out of
>> >> nowhere.
>> >>
>> >> defaultSpec
>> >> ^ SpecLayout composed
>> >>           newColumn: [ :col |
>> >>             col
>> >>                 newRow: [ :row |
>> >>                                       row
>> >>                                        add: #plaintiffsTextInput;
>> >>                                        add: #addButtonPlaintiffs ];
>> >>               newRow: [ :row |
>> >>                  row
>> >>                      add: #defendantsTextInput;
>> >>                      add: #addButtonDefendants ];
>> >>              newRow: [ :row |
>> >>                  row
>> >>                      add: #thirdPartiesTextInput;
>> >>                      add: #addButtonThirdParties ] ];
>> >> yourself
>> >>
>> >> Now I do not understand why when I add the next lines I get an error
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> On Mon, Mar 5, 2018 at 7:03 PM, Yuriy Babah <[hidden email]>
>> >> wrote:
>> >>> yesterday i did it, and got  -->  doesNotUndestand #layout
>> >>>
>> >>> 2018-03-05 20:28 GMT+03:00 Stephane Ducasse <[hidden email]>:
>> >>>>
>> >>>> First implement all the missing methods that you use in the spec
>> >>>> class
>> >>>> method.
>> >>>> Then let us know.
>> >>>>
>> >>>> Stef
>> >>>>
>> >>>>
>> >>>> On Sun, Mar 4, 2018 at 2:56 PM, Yuriy Babah <[hidden email]>
>> >>>> wrote:
>> >>>> > Thanks for your help, Stef.
>> >>>> > Mistakes remain, but I will try to understand them
>> >>>> >
>> >>>> > 2018-03-04 16:35 GMT+03:00 Stephane Ducasse
>> >>>> > <[hidden email]>:
>> >>>> >>
>> >>>> >> I'm doing a pass on your code
>> >>>> >>
>> >>>> >> OrderedCollection new is better to me than #()
>> >>>> >> asOrderedCollection.
>> >>>> >>
>> >>>> >> GUI_ListCourtCase new openWithSpec
>> >>>> >> => DNU
>> >>>> >> So I added the first missing method, but you should define the
>> >>>> >> corresponding methods in the class.
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >> On Sun, Mar 4, 2018 at 2:28 PM, Stephane Ducasse
>> >>>> >> <[hidden email]> wrote:
>> >>>> >> > Hi yuri
>> >>>> >> >
>> >>>> >> > some feedback before looking into spec.
>> >>>> >> > tab method bodies
>> >>>> >> > then do not use instance variables with uppercase.
>> >>>> >> >
>> >>>> >> > Stef
>> >>>> >> >
>> >>>> >> >
>> >>>> >> > On Sun, Mar 4, 2018 at 2:26 PM, Yuriy Babah
>> >>>> >> > <[hidden email]>
>> >>>> >> > wrote:
>> >>>> >> >> changed
>> >>>> >> >>
>> >>>> >> >> 2018-03-04 16:20 GMT+03:00 Yuriy Babah
>> >>>> >> >> <[hidden email]>:
>> >>>> >> >>>
>> >>>> >> >>> Is it enough if I just attach it?
>> >>>> >> >>>
>> >>>> >> >>> I slightly changed the code, that leads to error:
>> >>>> >> >>> "DoesNotUndestand
>> >>>> >> >>> #plaintiffsTextInput" .
>> >>>> >> >>>
>> >>>> >> >>> Now I'm studying Help on Spec in SystemBrowser .
>> >>>> >> >>>
>> >>>> >> >>>
>> >>>> >> >>>
>> >>>> >> >>> 2018-03-04 15:23 GMT+03:00 Stephane Ducasse
>> >>>> >> >>> <[hidden email]>:
>> >>>> >> >>>>
>> >>>> >> >>>> Hi Yuriy
>> >>>> >> >>>>
>> >>>> >> >>>> this is difficult to debug remotely. Do you have your code
>> >>>> >> >>>> somewhere?
>> >>>> >> >>>>
>> >>>> >> >>>> Stef
>> >>>> >> >>>>
>> >>>> >> >>>> On Sat, Mar 3, 2018 at 8:41 AM, Yuriy Babah
>> >>>> >> >>>> <[hidden email]>
>> >>>> >> >>>> wrote:
>> >>>> >> >>>> > Hi!
>> >>>> >> >>>> > I'm trying to write GUI element with Spec, Pharo6.1x64 on
>> >>>> >> >>>> > Linux.
>> >>>> >> >>>> > Do according to the SpecBooklet.
>> >>>> >> >>>> >
>> >>>> >> >>>> > Finished the fragment, and try do:
>> >>>> >> >>>> >
>> >>>> >> >>>> > ui := GUI_ListCourtCase new openWithSpec . -> #value was
>> >>>> >> >>>> > sent to
>> >>>> >> >>>> > nil.
>> >>>> >> >>>> >
>> >>>> >> >>>> > I look in a debugger and:
>> >>>> >> >>>> >
>> >>>> >> >>>> > openWithSpecLayout: aSpec
>> >>>> >> >>>> >     "Build the widget using the spec name provided as
>> >>>> >> >>>> > argument
>> >>>> >> >>>> > and
>> >>>> >> >>>> > display
>> >>>> >> >>>> > it into a window"
>> >>>> >> >>>> >
>> >>>> >> >>>> >     (window value notNil and: [ self needRebuild not ])
>> >>>> >> >>>> >         ifTrue: [ "window != nil"
>> >>>> >> >>>> >             window value rebuildWithSpecLayout: aSpec ]
>> >>>> >> >>>> >         ifFalse: [  "If value = Nil   --> send him a
>> >>>> >> >>>> > message
>> >>>> >> >>>> > ???"
>> >>>> >> >>>> >             window value: (self defaultWindowModelClass new
>> >>>> >> >>>> > model:
>> >>>> >> >>>> > self).
>> >>>> >> >>>> >             window value openWithSpecLayout: aSpec.
>> >>>> >> >>>> >             self takeKeyboardFocus ].
>> >>>> >> >>>> >
>> >>>> >> >>>> >     ^ window value
>> >>>> >> >>>>
>> >>>> >> >>>
>> >>>> >> >>
>> >>>> >
>> >>>> >
>> >>>>
>> >>>
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: my mistake on Spec?

Yuriy Babah
something understood, worked

 "
m: = GUI_ListCourtCase new.

m openWithSpec: # defaultSpec2.
"do something"
m inspect
 "

I see an instance variable that is not related to widgets

2018-03-07 22:11 GMT+03:00 Yuriy Babah <[hidden email]>:
i'm very pleased to!
Generally, I'm not a professional programmer. I'm a builder-designer.
Аlthough I have been interested in programming for a long time. Аnd sometimes I use it.
Faro is very elegant, he has a cool debugger and an inspector, in my opinion.
Well, you yourself probably know this.
I do my home project in my spare time, very slowly. Because of the large amount of basic work now.
I want to sort out a bunch of court cases of relatives and related information. Although, probably, some third-party service would make it much easier.
Probably, it's more just learning Faro and Spec.
Now there are questions how to associate my ComposableModel subclass and a regular class with my code.
When I do so "l: = GUI_ListCourtCase new openWithSpec: # defaultSpec2." and  try to look at the variable l, I do not see an instance variable that is not related to widgets.
I'm trying to initialize it in initializeWidjets, because when I create the method "initialize", I get an error.
Worst of all, that i'm not able be in time to investigate the emerging issues myself by the time I get the answers.
I do not want to make you think that I'm trying to get you to do my job )))
I can formulate my questions a little later))


2018-03-07 17:41 GMT+03:00 Stephane Ducasse <[hidden email]>:
I'm happy
Let us know about your project! And if you need I can do a code review.

Stef

On Tue, Mar 6, 2018 at 1:36 PM, Yuriy Babah <[hidden email]> wrote:
> Yes, i'm undestand. Looks good now.
>
>
>
>
> 2018-03-05 23:10 GMT+03:00 Stephane Ducasse <[hidden email]>:
>>
>> You should initialize the instance variable
>>
>> #subjectTextInput
>>
>> I suggest to do your UI incrementally.
>>
>> Stef
>>
>> On Mon, Mar 5, 2018 at 9:08 PM, Stephane Ducasse
>> <[hidden email]> wrote:
>> > defaultSpec2
>> > <spec: #default>
>> > ^ SpecLayout composed
>> > newColumn: [ :col |
>> > col
>> > newRow: [ :row |
>> > row
>> > add: #plaintiffsTextInput;
>> > add: #addButtonPlaintiffs ];
>> > newRow: [ :row |
>> > row
>> > add: #defendantsTextInput;
>> > add: #addButtonDefendants ];
>> > newRow: [ :row |
>> > row
>> > add: #thirdPartiesTextInput;
>> > add: #addButtonThirdParties ];
>> > newRow: [ :row | row add: #addButtonCourtCase ] ];
>> > yourself
>> >
>> > is working
>> >
>> >
>> >
>> >
>> >
>> >
>> > On Mon, Mar 5, 2018 at 9:00 PM, Stephane Ducasse
>> > <[hidden email]> wrote:
>> >> I'm trying to understand.
>> >> I do not get a DNU with the following. You cannot put row out of
>> >> nowhere.
>> >>
>> >> defaultSpec
>> >> ^ SpecLayout composed
>> >>           newColumn: [ :col |
>> >>             col
>> >>                 newRow: [ :row |
>> >>                                       row
>> >>                                        add: #plaintiffsTextInput;
>> >>                                        add: #addButtonPlaintiffs ];
>> >>               newRow: [ :row |
>> >>                  row
>> >>                      add: #defendantsTextInput;
>> >>                      add: #addButtonDefendants ];
>> >>              newRow: [ :row |
>> >>                  row
>> >>                      add: #thirdPartiesTextInput;
>> >>                      add: #addButtonThirdParties ] ];
>> >> yourself
>> >>
>> >> Now I do not understand why when I add the next lines I get an error
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> On Mon, Mar 5, 2018 at 7:03 PM, Yuriy Babah <[hidden email]>
>> >> wrote:
>> >>> yesterday i did it, and got  -->  doesNotUndestand #layout
>> >>>
>> >>> 2018-03-05 20:28 GMT+03:00 Stephane Ducasse <[hidden email]>:
>> >>>>
>> >>>> First implement all the missing methods that you use in the spec
>> >>>> class
>> >>>> method.
>> >>>> Then let us know.
>> >>>>
>> >>>> Stef
>> >>>>
>> >>>>
>> >>>> On Sun, Mar 4, 2018 at 2:56 PM, Yuriy Babah <[hidden email]>
>> >>>> wrote:
>> >>>> > Thanks for your help, Stef.
>> >>>> > Mistakes remain, but I will try to understand them
>> >>>> >
>> >>>> > 2018-03-04 16:35 GMT+03:00 Stephane Ducasse
>> >>>> > <[hidden email]>:
>> >>>> >>
>> >>>> >> I'm doing a pass on your code
>> >>>> >>
>> >>>> >> OrderedCollection new is better to me than #()
>> >>>> >> asOrderedCollection.
>> >>>> >>
>> >>>> >> GUI_ListCourtCase new openWithSpec
>> >>>> >> => DNU
>> >>>> >> So I added the first missing method, but you should define the
>> >>>> >> corresponding methods in the class.
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >> On Sun, Mar 4, 2018 at 2:28 PM, Stephane Ducasse
>> >>>> >> <[hidden email]> wrote:
>> >>>> >> > Hi yuri
>> >>>> >> >
>> >>>> >> > some feedback before looking into spec.
>> >>>> >> > tab method bodies
>> >>>> >> > then do not use instance variables with uppercase.
>> >>>> >> >
>> >>>> >> > Stef
>> >>>> >> >
>> >>>> >> >
>> >>>> >> > On Sun, Mar 4, 2018 at 2:26 PM, Yuriy Babah
>> >>>> >> > <[hidden email]>
>> >>>> >> > wrote:
>> >>>> >> >> changed
>> >>>> >> >>
>> >>>> >> >> 2018-03-04 16:20 GMT+03:00 Yuriy Babah
>> >>>> >> >> <[hidden email]>:
>> >>>> >> >>>
>> >>>> >> >>> Is it enough if I just attach it?
>> >>>> >> >>>
>> >>>> >> >>> I slightly changed the code, that leads to error:
>> >>>> >> >>> "DoesNotUndestand
>> >>>> >> >>> #plaintiffsTextInput" .
>> >>>> >> >>>
>> >>>> >> >>> Now I'm studying Help on Spec in SystemBrowser .
>> >>>> >> >>>
>> >>>> >> >>>
>> >>>> >> >>>
>> >>>> >> >>> 2018-03-04 15:23 GMT+03:00 Stephane Ducasse
>> >>>> >> >>> <[hidden email]>:
>> >>>> >> >>>>
>> >>>> >> >>>> Hi Yuriy
>> >>>> >> >>>>
>> >>>> >> >>>> this is difficult to debug remotely. Do you have your code
>> >>>> >> >>>> somewhere?
>> >>>> >> >>>>
>> >>>> >> >>>> Stef
>> >>>> >> >>>>
>> >>>> >> >>>> On Sat, Mar 3, 2018 at 8:41 AM, Yuriy Babah
>> >>>> >> >>>> <[hidden email]>
>> >>>> >> >>>> wrote:
>> >>>> >> >>>> > Hi!
>> >>>> >> >>>> > I'm trying to write GUI element with Spec, Pharo6.1x64 on
>> >>>> >> >>>> > Linux.
>> >>>> >> >>>> > Do according to the SpecBooklet.
>> >>>> >> >>>> >
>> >>>> >> >>>> > Finished the fragment, and try do:
>> >>>> >> >>>> >
>> >>>> >> >>>> > ui := GUI_ListCourtCase new openWithSpec . -> #value was
>> >>>> >> >>>> > sent to
>> >>>> >> >>>> > nil.
>> >>>> >> >>>> >
>> >>>> >> >>>> > I look in a debugger and:
>> >>>> >> >>>> >
>> >>>> >> >>>> > openWithSpecLayout: aSpec
>> >>>> >> >>>> >     "Build the widget using the spec name provided as
>> >>>> >> >>>> > argument
>> >>>> >> >>>> > and
>> >>>> >> >>>> > display
>> >>>> >> >>>> > it into a window"
>> >>>> >> >>>> >
>> >>>> >> >>>> >     (window value notNil and: [ self needRebuild not ])
>> >>>> >> >>>> >         ifTrue: [ "window != nil"
>> >>>> >> >>>> >             window value rebuildWithSpecLayout: aSpec ]
>> >>>> >> >>>> >         ifFalse: [  "If value = Nil   --> send him a
>> >>>> >> >>>> > message
>> >>>> >> >>>> > ???"
>> >>>> >> >>>> >             window value: (self defaultWindowModelClass new
>> >>>> >> >>>> > model:
>> >>>> >> >>>> > self).
>> >>>> >> >>>> >             window value openWithSpecLayout: aSpec.
>> >>>> >> >>>> >             self takeKeyboardFocus ].
>> >>>> >> >>>> >
>> >>>> >> >>>> >     ^ window value
>> >>>> >> >>>>
>> >>>> >> >>>
>> >>>> >> >>
>> >>>> >
>> >>>> >
>> >>>>
>> >>>
>>
>



Reply | Threaded
Open this post in threaded view
|

Re: my mistake on Spec?

Sean P. DeNigris
Administrator
Yuriy Babah wrote
> something understood, worked

Great! Feel free to keep asking questions and also there are several Discord
channels where one can often get immediate dialogue and answers.



-----
Cheers,
Sean
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Cheers,
Sean