Fast Table causes Instances of Matrix are not indexable?

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

Fast Table causes Instances of Matrix are not indexable?

alistairgrant
Hi All,

I've just upgrade from Pharo 60395 to 60411 and am now unable to
inspect instances of Matrix.

I think I read somewhere that the GTInspector is now using fast tables,
and am guessing that it is this change that is causing the problem.

I've included code below to reproduce the problem and a stack trace.
The sample code creates a 3 x 3 matrix.

FTTableContainerMorph>>updateExposedRows suggests that the matrix is
being treated as a one-dimensional collection:

self owner numberOfRows  => 9 "expected 3"
self owner numberOfColumns  => 1 "expected 3"

I'll keep investigating, but if someone more familiar can point me in
the right direction, any hints will be appreciated.

Thanks,
Alistair

Pharo 6.0
Latest update: #60411
OS: 4.9.8-1-ARCH



| m |

m := Matrix rows: 3 columns: 3.
1 to: 3 do: [ :i |
1 to: 3 do: [ :j |
m at: i at: j put: 'C', i printString, j printString ] ].
m inspect



Matrix(Object)>>error:
Matrix(Object)>>errorNotIndexable
Matrix(Object)>>at:
GLMFastListDataSource(FTSimpleDataSource)>>elementAt:
GLMFastListDataSource>>cellColumn:row:
FTTableContainerMorph>>updateExposedRows
FTTableMorph>>resetPosition
FTTableMorph>>resizeAllSubviews
FTTableMorph>>extent:
FTTableMorph(Morph)>>bounds:
FTTableMorph(Morph)>>layoutInBounds:
FTTableMorph(Morph)>>layoutProportionallyIn:
[ :m | m layoutProportionallyIn: newBounds ] in
ProportionalLayout>>layout:in: in Block: [ :m | m
layoutProportionallyIn: newBounds ]
Array(SequenceableCollection)>>do:
GLMPanelMorph(Morph)>>submorphsDo:
ProportionalLayout>>layout:in:
GLMPanelMorph(Morph)>>doLayoutIn:
[ self doLayoutIn: self layoutBounds ] in
GLMPanelMorph(Morph)>>computeFullBounds in Block: [ self doLayoutIn:
self layoutBounds ]
BlockClosure>>on:do:
GLMPanelMorph(Morph)>>computeFullBounds
GLMPanelMorph(Morph)>>fullBounds
[ :m |
| subBox |
m visible
ifTrue: [ subBox := m fullBounds.
box
ifNil: [ box := subBox copy ]
ifNotNil: [ box := box quickMerge: subBox ] ] ] in
GLMPanelMorph(Morph)>>submorphBounds in Block: [ :m | ...
Array(SequenceableCollection)>>do:
GLMPanelMorph(Morph)>>submorphBounds
GLMPanelMorph(Morph)>>privateFullBounds
GLMPanelMorph(Morph)>>doLayoutIn:
[ self doLayoutIn: self layoutBounds ] in
GLMPanelMorph(Morph)>>computeFullBounds in Block: [ self doLayoutIn:
self layoutBounds ]
BlockClosure>>on:do:
GLMPanelMorph(Morph)>>computeFullBounds
GLMPanelMorph(Morph)>>fullBounds

Reply | Threaded
Open this post in threaded view
|

Re: Fast Table causes Instances of Matrix are not indexable?

Andrei Chis
Hi Alistair,

I do not have access to a computer right now but indeed this is related to GTInspector moving to fast table. You should be able to temporarily solve this be defining a custom Items presentation in the Matrix class that in the display block transforms the martix to an ordered collection.

We'll integrate a fix at the beginning of next week to solve this in the inspector without requiring a new presentation.

Cheers,
Andeei

On Feb 25, 2017 12:10 PM, "Alistair Grant" <[hidden email]> wrote:
Hi All,

I've just upgrade from Pharo 60395 to 60411 and am now unable to
inspect instances of Matrix.

I think I read somewhere that the GTInspector is now using fast tables,
and am guessing that it is this change that is causing the problem.

I've included code below to reproduce the problem and a stack trace.
The sample code creates a 3 x 3 matrix.

FTTableContainerMorph>>updateExposedRows suggests that the matrix is
being treated as a one-dimensional collection:

self owner numberOfRows  => 9 "expected 3"
self owner numberOfColumns  => 1 "expected 3"

I'll keep investigating, but if someone more familiar can point me in
the right direction, any hints will be appreciated.

Thanks,
Alistair

Pharo 6.0
Latest update: #60411
OS: 4.9.8-1-ARCH



| m |

m := Matrix rows: 3 columns: 3.
1 to: 3 do: [ :i |
1 to: 3 do: [ :j |
m at: i at: j put: 'C', i printString, j printString ] ].
m inspect



Matrix(Object)>>error:
Matrix(Object)>>errorNotIndexable
Matrix(Object)>>at:
GLMFastListDataSource(FTSimpleDataSource)>>elementAt:
GLMFastListDataSource>>cellColumn:row:
FTTableContainerMorph>>updateExposedRows
FTTableMorph>>resetPosition
FTTableMorph>>resizeAllSubviews
FTTableMorph>>extent:
FTTableMorph(Morph)>>bounds:
FTTableMorph(Morph)>>layoutInBounds:
FTTableMorph(Morph)>>layoutProportionallyIn:
[ :m | m layoutProportionallyIn: newBounds ] in
ProportionalLayout>>layout:in: in Block: [ :m | m
layoutProportionallyIn: newBounds ]
Array(SequenceableCollection)>>do:
GLMPanelMorph(Morph)>>submorphsDo:
ProportionalLayout>>layout:in:
GLMPanelMorph(Morph)>>doLayoutIn:
[ self doLayoutIn: self layoutBounds ] in
GLMPanelMorph(Morph)>>computeFullBounds in Block: [ self doLayoutIn:
self layoutBounds ]
BlockClosure>>on:do:
GLMPanelMorph(Morph)>>computeFullBounds
GLMPanelMorph(Morph)>>fullBounds
[ :m |
| subBox |
m visible
ifTrue: [ subBox := m fullBounds.
box
ifNil: [ box := subBox copy ]
ifNotNil: [ box := box quickMerge: subBox ] ] ] in
GLMPanelMorph(Morph)>>submorphBounds in Block: [ :m | ...
Array(SequenceableCollection)>>do:
GLMPanelMorph(Morph)>>submorphBounds
GLMPanelMorph(Morph)>>privateFullBounds
GLMPanelMorph(Morph)>>doLayoutIn:
[ self doLayoutIn: self layoutBounds ] in
GLMPanelMorph(Morph)>>computeFullBounds in Block: [ self doLayoutIn:
self layoutBounds ]
BlockClosure>>on:do:
GLMPanelMorph(Morph)>>computeFullBounds
GLMPanelMorph(Morph)>>fullBounds


Reply | Threaded
Open this post in threaded view
|

Re: Fast Table causes Instances of Matrix are not indexable?

alistairgrant
Hi Andrei,

Thanks for the suggestion!  That avoids the problem until the fix is in.

Thanks again,
Alistair


On 25 February 2017 at 22:50, Andrei Chis <[hidden email]> wrote:

> Hi Alistair,
>
> I do not have access to a computer right now but indeed this is related to
> GTInspector moving to fast table. You should be able to temporarily solve
> this be defining a custom Items presentation in the Matrix class that in the
> display block transforms the martix to an ordered collection.
>
> We'll integrate a fix at the beginning of next week to solve this in the
> inspector without requiring a new presentation.
>
> Cheers,
> Andeei
>
>
> On Feb 25, 2017 12:10 PM, "Alistair Grant" <[hidden email]> wrote:
>
> Hi All,
>
> I've just upgrade from Pharo 60395 to 60411 and am now unable to
> inspect instances of Matrix.
>
> I think I read somewhere that the GTInspector is now using fast tables,
> and am guessing that it is this change that is causing the problem.
>
> I've included code below to reproduce the problem and a stack trace.
> The sample code creates a 3 x 3 matrix.
>
> FTTableContainerMorph>>updateExposedRows suggests that the matrix is
> being treated as a one-dimensional collection:
>
> self owner numberOfRows  => 9 "expected 3"
> self owner numberOfColumns  => 1 "expected 3"
>
> I'll keep investigating, but if someone more familiar can point me in
> the right direction, any hints will be appreciated.
>
> Thanks,
> Alistair
>
> Pharo 6.0
> Latest update: #60411
> OS: 4.9.8-1-ARCH
>
>
>
> | m |
>
> m := Matrix rows: 3 columns: 3.
> 1 to: 3 do: [ :i |
> 1 to: 3 do: [ :j |
> m at: i at: j put: 'C', i printString, j printString ] ].
> m inspect
>
>
>
> Matrix(Object)>>error:
> Matrix(Object)>>errorNotIndexable
> Matrix(Object)>>at:
> GLMFastListDataSource(FTSimpleDataSource)>>elementAt:
> GLMFastListDataSource>>cellColumn:row:
> FTTableContainerMorph>>updateExposedRows
> FTTableMorph>>resetPosition
> FTTableMorph>>resizeAllSubviews
> FTTableMorph>>extent:
> FTTableMorph(Morph)>>bounds:
> FTTableMorph(Morph)>>layoutInBounds:
> FTTableMorph(Morph)>>layoutProportionallyIn:
> [ :m | m layoutProportionallyIn: newBounds ] in
> ProportionalLayout>>layout:in: in Block: [ :m | m
> layoutProportionallyIn: newBounds ]
> Array(SequenceableCollection)>>do:
> GLMPanelMorph(Morph)>>submorphsDo:
> ProportionalLayout>>layout:in:
> GLMPanelMorph(Morph)>>doLayoutIn:
> [ self doLayoutIn: self layoutBounds ] in
> GLMPanelMorph(Morph)>>computeFullBounds in Block: [ self doLayoutIn:
> self layoutBounds ]
> BlockClosure>>on:do:
> GLMPanelMorph(Morph)>>computeFullBounds
> GLMPanelMorph(Morph)>>fullBounds
> [ :m |
> | subBox |
> m visible
> ifTrue: [ subBox := m fullBounds.
> box
> ifNil: [ box := subBox copy ]
> ifNotNil: [ box := box quickMerge: subBox ] ] ] in
> GLMPanelMorph(Morph)>>submorphBounds in Block: [ :m | ...
> Array(SequenceableCollection)>>do:
> GLMPanelMorph(Morph)>>submorphBounds
> GLMPanelMorph(Morph)>>privateFullBounds
> GLMPanelMorph(Morph)>>doLayoutIn:
> [ self doLayoutIn: self layoutBounds ] in
> GLMPanelMorph(Morph)>>computeFullBounds in Block: [ self doLayoutIn:
> self layoutBounds ]
> BlockClosure>>on:do:
> GLMPanelMorph(Morph)>>computeFullBounds
> GLMPanelMorph(Morph)>>fullBounds
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Fast Table causes Instances of Matrix are not indexable?

stepharong
In reply to this post by alistairgrant
Hi alistair

if you use matrix as a grid (and not as a mathematical matrix) you may  
want to have a look at
        2Darray and Grid
available in Containers

        http://smalltalkhub.com/#!/~StephaneDucasse/Containers

        MCHttpRepository
        location: 'http://smalltalkhub.com/mc/StephaneDucasse/Containers/main'
        user: ''
        password: ''


> Hi All,
>
> I've just upgrade from Pharo 60395 to 60411 and am now unable to
> inspect instances of Matrix.
>
> I think I read somewhere that the GTInspector is now using fast tables,
> and am guessing that it is this change that is causing the problem.
>
> I've included code below to reproduce the problem and a stack trace.
> The sample code creates a 3 x 3 matrix.
>
> FTTableContainerMorph>>updateExposedRows suggests that the matrix is
> being treated as a one-dimensional collection:
>
> self owner numberOfRows  => 9 "expected 3"
> self owner numberOfColumns  => 1 "expected 3"
>
> I'll keep investigating, but if someone more familiar can point me in
> the right direction, any hints will be appreciated.
>
> Thanks,
> Alistair
>
> Pharo 6.0
> Latest update: #60411
> OS: 4.9.8-1-ARCH
>
>
>
> | m |
>
> m := Matrix rows: 3 columns: 3.
> 1 to: 3 do: [ :i |
> 1 to: 3 do: [ :j |
> m at: i at: j put: 'C', i printString, j printString ] ].
> m inspect
>
>
>
> Matrix(Object)>>error:
> Matrix(Object)>>errorNotIndexable
> Matrix(Object)>>at:
> GLMFastListDataSource(FTSimpleDataSource)>>elementAt:
> GLMFastListDataSource>>cellColumn:row:
> FTTableContainerMorph>>updateExposedRows
> FTTableMorph>>resetPosition
> FTTableMorph>>resizeAllSubviews
> FTTableMorph>>extent:
> FTTableMorph(Morph)>>bounds:
> FTTableMorph(Morph)>>layoutInBounds:
> FTTableMorph(Morph)>>layoutProportionallyIn:
> [ :m | m layoutProportionallyIn: newBounds ] in
> ProportionalLayout>>layout:in: in Block: [ :m | m
> layoutProportionallyIn: newBounds ]
> Array(SequenceableCollection)>>do:
> GLMPanelMorph(Morph)>>submorphsDo:
> ProportionalLayout>>layout:in:
> GLMPanelMorph(Morph)>>doLayoutIn:
> [ self doLayoutIn: self layoutBounds ] in
> GLMPanelMorph(Morph)>>computeFullBounds in Block: [ self doLayoutIn:
> self layoutBounds ]
> BlockClosure>>on:do:
> GLMPanelMorph(Morph)>>computeFullBounds
> GLMPanelMorph(Morph)>>fullBounds
> [ :m |
> | subBox |
> m visible
> ifTrue: [ subBox := m fullBounds.
> box
> ifNil: [ box := subBox copy ]
> ifNotNil: [ box := box quickMerge: subBox ] ] ] in
> GLMPanelMorph(Morph)>>submorphBounds in Block: [ :m | ...
> Array(SequenceableCollection)>>do:
> GLMPanelMorph(Morph)>>submorphBounds
> GLMPanelMorph(Morph)>>privateFullBounds
> GLMPanelMorph(Morph)>>doLayoutIn:
> [ self doLayoutIn: self layoutBounds ] in
> GLMPanelMorph(Morph)>>computeFullBounds in Block: [ self doLayoutIn:
> self layoutBounds ]
> BlockClosure>>on:do:
> GLMPanelMorph(Morph)>>computeFullBounds
> GLMPanelMorph(Morph)>>fullBounds
>


--
Using Opera's mail client: http://www.opera.com/mail/

Reply | Threaded
Open this post in threaded view
|

Re: Fast Table causes Instances of Matrix are not indexable?

alistairgrant
Hi Stef,

On 26 February 2017 at 01:16, stepharong <[hidden email]> wrote:

> Hi alistair
>
> if you use matrix as a grid (and not as a mathematical matrix) you may want
> to have a look at
>         2Darray and Grid
> available in Containers
>
>         http://smalltalkhub.com/#!/~StephaneDucasse/Containers
>
>         MCHttpRepository
>         location:
> 'http://smalltalkhub.com/mc/StephaneDucasse/Containers/main'
>         user: ''
>         password: ''

Thanks for the pointer, I'll have a look.

Cheers,
Alistair