Glamour-Examples comparison 4.5 v 4.6 - Class GLMBasicExamples

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

Glamour-Examples comparison 4.5 v 4.6 - Class GLMBasicExamples

Ben Coman

btw, I am on Windows 7.

The GLMExamplesBrowser menu item [View browser tree] is interesting...



NEW IN 4.6
Do the following demonstrate new functionality in 4.6 or just a new
example of existing 4.5 functionality ?

#formatAsWords - what does this have to do with composites protocol?

#listDragAndDrop
new to 4.6 - very nice :)
A useful addition would be allowing drop onto background of [Target]
(which might be item + 0)
Dropping onto a number in [Source] causes an error
An additional comment to describe operation of the example would be
useful eg.. "Drag a number from Source into Target dropping on either an
item or the background"

#smalltalkCode


#spawnBrowserActions - it would be useful to also see how a single
selected item could be opened in a new window - not just the whole list)

#spawnBrowserSelectionActions (note, the method of in-comment example is
incorrect)





[*1]  operational change...
4.5 has a default window menu    ==>  4.6 does not - why the difference ?[3]

[*2]
    finder list   ==>       finder show: [ :a | a list
    browser text    ==>   browser show: [ :a | a text
    finder table   ==>   finder show: [ :a | a table

    Browser menu  #simpleFinderWithMenu
    Filter   #multipleFinderWithFilter
    Finder  #simpleFinder
    Populate port action  #populatePortAction
    Search  #multipleFinderWithFilterAndSearch
    Toolbar  #browserWithToolbar
    Tabs with different labels  #tabsWithDifferentLabels
    #treeWithInitialSelection - actually this gets a MNU
GLMTabulator>>text in 4.6 - needs one more refactoring


[*3] #using seems to be being purged from Glamour.  Perhaps to remove a
lot of methods from GLMBrowser & GLMTPresentationBuilder, leaving these
only in GLMCompositePresentation. Examples...
    showOn: ... using: [ browser mondrian    ==>    transmit to: ....
andShow: [ :a | a mondrian
    showOn: ... using: [ browser list     ==>  transmit to: ... andShow:
[ :a | a list
    showOn: ... using: [ browser morph  ==> transmit to: ... andShow: [
:a | a morph

    Action list  #simpleActionList
    Allowing all nil  #allowAllNil
    Allowing nil  #allowNil
    Drop-down  #dropDownList  [
    Drop-down with initial value   #dropDownListWithInitialValue
    Fix size pane  #fixSizePanes
    Morph icons  #morphIcons
    Tags  #compoundTaggedTree
    Updated selection  #listsWithUpdatedSelection
    (no glmBrowser pragma) #singleInitialSelection

[*4]     #sendTo:from:with:  ==>      #transmit:port:   ;  #from:  ;  
#transformed

    Updated selection  #listsWithUpdatedSelection


[*6]      Transcript     ==>      Inspector    (not really a significant
change?)
    Action list  #simpleActionList [*3,6]
    Menus  #staticAndDynamicMenu [*6]



DOES NOT WORK IN 4.6
#interdependentPanes - code is flagged as not working. does not work in
4.5 either.


FIXED IN 4.6, WAS NON-WORKING IN 4.5
Double click #doubleClick
#simpleTable
#textPortsExamples

#accumulator - Accumulator - looks like an example design change to
separate concerns. Double clicking a number in the left pane, in the
right pane brings up...
    4.5 - number tab with sub-tabs 'List' & 'Text' as well as a
connect-menu item 'Inspect'
    4.6 - number tab only, no sub-tabs or context menu

WORKS FROM EXAMPLE BROWSER BUT NOT FROM METHOD COMMENT
#textSelection - execute from method comment works in 4.5 but fails in
4.6 with unknown selector #textSelectionInterval.

OPERATES THE SAME - CODE DIFFERENCE AS NOTED

Dashboard  #dashboard
Dashboard specifying extents  #dashboardWithSpecificExtents
Dashboards in dashboard  #dashboardsInDashboard
Composite arrangements  #differentComposites
Complex morphs (StarBrowser simulation)  #starBrowser
EyeSee interactive bar chart  #eyeseeBarDiagram
Mondrian painting  #mondrianPainting
Multiple actions  #multipleActions
Simple Expander  #simpleExpander
Smart lists  #treeWithAmountFiltering
Stacker  #stacker
Tabs with different actions  #tabsWithDifferentActions
Three inter-dependent panes  #threeInterdependentPanes
Tree with children by level  #treeWithChildrenByLevel
Tree with expansion  #treeWithExpansion
(no glmBrowser pragma)    #taggedTree

(no glmBrowser pragma) #multiInitialSelection [*1,3] - but I am only
able to multi-select contiguous items with the SHIFT key.  I am unable
to multi-select non-contiguous items as I would expect using the CTRL
key.  Instead a context menu for MorphTreeMorph appears.   Is this
unfortunate behaviour just me?



#magritte - This was one a was I was REALLY interested to see regarding
the update to Magritte 3.  However the code is identical to 4.5.  Both
4.5 and 4.6 produce the same error....
  [Save] ==> error MAWriteError: Not supposed to write to something.
  [Cancel] ==> no change. Now without knowing anything about Magritte, I
would expect the text box to revert to the original text.
What would actually be a fantastic example here would be a small address
book of a few entries that browsed a list in one pane and in another the
magritte detail could be edited.


#tableWithIcons
    4.6 also adds alternating icons.
    4.5 broken & does not transmit to next pane, but same code to 4.6
does work.
    selectionAct: [:tree | tree inspect ]  ==>  selectionAct: [:tree |
tree selection inspect ]



This has been improved in 4.6 to auto-expand when moving from [first
tree] to [second tree]
However in both 4.5 & 4.6, upon initial opening and when switching from
[first tree] to [second tree] an erroneous additional line spacing
occurs as shown in _ treeWithInitialSelection-extra-line-spacing.jpg _
(attached)

#treeWithMenu - might need the same change to selectionAct: as for  
#tableWithIcons
#treeWithTags [*1]

#treeWithTagsMoreLevels [*1] - it would be good if after deselecting the
tags, it remembered which node had previously been expanded.  When when
I click a tag twice, I expect to get back the same view I had before.

#updateableBrowser [*1] Completely different code and operation. What is
the difference in operation between the 'Upadted automatically' tab and
'Updated via menu' -

#validator [*6]
#validatorDynamic [*6] - but I don't actually see any difference to
operation of #validator method - what am I missing ?

#wizard - it is not clear how to get the selected items



















_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

treeWithInitialSelection-extra-line-spacing.gif (32K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Glamour-Examples comparison 4.5 v 4.6 - Class GLMBasicExamples

Stéphane Ducasse
Thanks for this great report!

Stef
On Feb 27, 2012, at 3:54 PM, Ben Coman wrote:

>
> btw, I am on Windows 7.
>
> The GLMExamplesBrowser menu item [View browser tree] is interesting...
>
>
>
> NEW IN 4.6
> Do the following demonstrate new functionality in 4.6 or just a new example of existing 4.5 functionality ?
>
> #formatAsWords - what does this have to do with composites protocol?
> #listDragAndDrop
> new to 4.6 - very nice :)
> A useful addition would be allowing drop onto background of [Target] (which might be item + 0)
> Dropping onto a number in [Source] causes an error
> An additional comment to describe operation of the example would be useful eg.. "Drag a number from Source into Target dropping on either an item or the background"
>
> #smalltalkCode
>
>
> #spawnBrowserActions - it would be useful to also see how a single selected item could be opened in a new window - not just the whole list)
>
> #spawnBrowserSelectionActions (note, the method of in-comment example is incorrect)
>
>
>
>
>
> [*1]  operational change...
> 4.5 has a default window menu    ==>  4.6 does not - why the difference ?[3]
>
> [*2]
>   finder list   ==>       finder show: [ :a | a list
>   browser text    ==>   browser show: [ :a | a text
>   finder table   ==>   finder show: [ :a | a table
>
>   Browser menu  #simpleFinderWithMenu
>   Filter   #multipleFinderWithFilter
>   Finder  #simpleFinder
>   Populate port action  #populatePortAction    Search  #multipleFinderWithFilterAndSearch    Toolbar  #browserWithToolbar    Tabs with different labels  #tabsWithDifferentLabels
>   #treeWithInitialSelection - actually this gets a MNU GLMTabulator>>text in 4.6 - needs one more refactoring
>
>
> [*3] #using seems to be being purged from Glamour.  Perhaps to remove a lot of methods from GLMBrowser & GLMTPresentationBuilder, leaving these only in GLMCompositePresentation. Examples...
>   showOn: ... using: [ browser mondrian    ==>    transmit to: .... andShow: [ :a | a mondrian
>   showOn: ... using: [ browser list     ==>  transmit to: ... andShow: [ :a | a list
>   showOn: ... using: [ browser morph  ==> transmit to: ... andShow: [ :a | a morph
>
>   Action list  #simpleActionList
>   Allowing all nil  #allowAllNil
>   Allowing nil  #allowNil    Drop-down  #dropDownList  [
>   Drop-down with initial value   #dropDownListWithInitialValue
>   Fix size pane  #fixSizePanes    Morph icons  #morphIcons    Tags  #compoundTaggedTree    Updated selection  #listsWithUpdatedSelection    (no glmBrowser pragma) #singleInitialSelection
>
> [*4]     #sendTo:from:with:  ==>      #transmit:port:   ;  #from:  ;  #transformed
>
>   Updated selection  #listsWithUpdatedSelection
>
>
> [*6]      Transcript     ==>      Inspector    (not really a significant change?)
>   Action list  #simpleActionList [*3,6]
>   Menus  #staticAndDynamicMenu [*6]
>
>
>
> DOES NOT WORK IN 4.6
> #interdependentPanes - code is flagged as not working. does not work in 4.5 either.
>
>
> FIXED IN 4.6, WAS NON-WORKING IN 4.5
> Double click #doubleClick
> #simpleTable
> #textPortsExamples
>
> #accumulator - Accumulator - looks like an example design change to separate concerns. Double clicking a number in the left pane, in the right pane brings up...
>   4.5 - number tab with sub-tabs 'List' & 'Text' as well as a connect-menu item 'Inspect'
>   4.6 - number tab only, no sub-tabs or context menu
>
> WORKS FROM EXAMPLE BROWSER BUT NOT FROM METHOD COMMENT
> #textSelection - execute from method comment works in 4.5 but fails in 4.6 with unknown selector #textSelectionInterval.
>
> OPERATES THE SAME - CODE DIFFERENCE AS NOTED
>
> Dashboard  #dashboard
> Dashboard specifying extents  #dashboardWithSpecificExtents
> Dashboards in dashboard  #dashboardsInDashboard
> Composite arrangements  #differentComposites
> Complex morphs (StarBrowser simulation)  #starBrowser
> EyeSee interactive bar chart  #eyeseeBarDiagram
> Mondrian painting  #mondrianPainting
> Multiple actions  #multipleActions
> Simple Expander  #simpleExpander
> Smart lists  #treeWithAmountFiltering
> Stacker  #stacker
> Tabs with different actions  #tabsWithDifferentActions
> Three inter-dependent panes  #threeInterdependentPanes
> Tree with children by level  #treeWithChildrenByLevel
> Tree with expansion  #treeWithExpansion
> (no glmBrowser pragma)    #taggedTree
>
> (no glmBrowser pragma) #multiInitialSelection [*1,3] - but I am only able to multi-select contiguous items with the SHIFT key.  I am unable to multi-select non-contiguous items as I would expect using the CTRL key.  Instead a context menu for MorphTreeMorph appears.   Is this unfortunate behaviour just me?
>
>
>
> #magritte - This was one a was I was REALLY interested to see regarding the update to Magritte 3.  However the code is identical to 4.5.  Both 4.5 and 4.6 produce the same error....
> [Save] ==> error MAWriteError: Not supposed to write to something.
> [Cancel] ==> no change. Now without knowing anything about Magritte, I would expect the text box to revert to the original text.
> What would actually be a fantastic example here would be a small address book of a few entries that browsed a list in one pane and in another the magritte detail could be edited.
>
>
> #tableWithIcons
>   4.6 also adds alternating icons.
>   4.5 broken & does not transmit to next pane, but same code to 4.6 does work.
>   selectionAct: [:tree | tree inspect ]  ==>  selectionAct: [:tree | tree selection inspect ]
>
>
>
> This has been improved in 4.6 to auto-expand when moving from [first tree] to [second tree]
> However in both 4.5 & 4.6, upon initial opening and when switching from [first tree] to [second tree] an erroneous additional line spacing occurs as shown in _ treeWithInitialSelection-extra-line-spacing.jpg _ (attached)
>
> #treeWithMenu - might need the same change to selectionAct: as for  #tableWithIcons
> #treeWithTags [*1]
>
> #treeWithTagsMoreLevels [*1] - it would be good if after deselecting the tags, it remembered which node had previously been expanded.  When when I click a tag twice, I expect to get back the same view I had before.
>
> #updateableBrowser [*1] Completely different code and operation. What is the difference in operation between the 'Upadted automatically' tab and 'Updated via menu' -
>
> #validator [*6]
> #validatorDynamic [*6] - but I don't actually see any difference to operation of #validator method - what am I missing ?
>
> #wizard - it is not clear how to get the selected items
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> <treeWithInitialSelection-extra-line-spacing.gif>_______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Glamour-Examples comparison 4.5 v 4.6 - Class GLMBasicExamples IGNORE THE FIRST ONE

Ben Coman
In reply to this post by Ben Coman
Ben Coman wrote:
>
> btw, I am on Windows 7.
>
> The GLMExamplesBrowser menu item [View browser tree] is interesting...
>
Sorry.  I slipped and the first one was sent too early, half way through
sorting.  Please read my second post.
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Glamour-Examples comparison 4.5 v 4.6 - Class GLMBasicExamples

Tudor Girba-2
In reply to this post by Ben Coman
Hi Ben,

Thanks for the post. I think this is the first time someone looks at these examples in so much detail :).

I added some points inline.


On 27 Feb 2012, at 15:54, Ben Coman wrote:

>
> btw, I am on Windows 7.
>
> The GLMExamplesBrowser menu item [View browser tree] is interesting...

Thanks :)

You can learn a bit more about it here:
http://www.humane-assessment.com/stories/rogue-announcements/


> NEW IN 4.6
> Do the following demonstrate new functionality in 4.6 or just a new example of existing 4.5 functionality ?
>
> #formatAsWords - what does this have to do with composites protocol?

I do not understand the question. This example simply shows how you can use format to customize how each item gets displayed.


> #listDragAndDrop
> new to 4.6 - very nice :)
> A useful addition would be allowing drop onto background of [Target] (which might be item + 0)
> Dropping onto a number in [Source] causes an error
> An additional comment to describe operation of the example would be useful eg.. "Drag a number from Source into Target dropping on either an item or the background"

This feature is only in 4.6. However, as you can see it's not quite complete.


> #smalltalkCode

This one existed in a different form.

>
> #spawnBrowserActions - it would be useful to also see how a single selected item could be opened in a new window - not just the whole list)

Just replace "presentation entity" with "presentation selection"

> #spawnBrowserSelectionActions (note, the method of in-comment example is incorrect)

Thanks, I corrected it. Btw, this example does what you asked above.


>
> [*1]  operational change...
> 4.5 has a default window menu    ==>  4.6 does not - why the difference ?[3]

Because the default menu is useless. What's more it actually hurts: when you put a meaningful action, you want the user to know it's there. But, given that the user is used to useless actions, he will not look in the menu anymore. So, now, there is no default menu, and it's better :)


> [*2]
>   finder list   ==>       finder show: [ :a | a list
>   browser text    ==>   browser show: [ :a | a text
>   finder table   ==>   finder show: [ :a | a table

These are part of the change in the API. Now, we always use show:, andShow: or andShowIfNone: whenever we want to define the presentations that go with the transmission. These blocks always get one parameter with a composite presentation and the messages like "list" or "text" are constructors of the child presentations.


>   Browser menu  #simpleFinderWithMenu
>   Filter   #multipleFinderWithFilter
>   Finder  #simpleFinder
>   Populate port action  #populatePortAction    Search  #multipleFinderWithFilterAndSearch    Toolbar  #browserWithToolbar    Tabs with different labels  #tabsWithDifferentLabels
>   #treeWithInitialSelection - actually this gets a MNU GLMTabulator>>text in 4.6 - needs one more refactoring

Thanks, I fixed it, but the example is still broken because it does not show the default selection.


> [*3] #using seems to be being purged from Glamour.  Perhaps to remove a lot of methods from GLMBrowser & GLMTPresentationBuilder, leaving these only in GLMCompositePresentation. Examples...
>   showOn: ... using: [ browser mondrian    ==>    transmit to: .... andShow: [ :a | a mondrian
>   showOn: ... using: [ browser list     ==>  transmit to: ... andShow: [ :a | a list
>   showOn: ... using: [ browser morph  ==> transmit to: ... andShow: [ :a | a morph

These are part of the change in the API. See above.


>   Action list  #simpleActionList
>   Allowing all nil  #allowAllNil
>   Allowing nil  #allowNil    Drop-down  #dropDownList  [
>   Drop-down with initial value   #dropDownListWithInitialValue
>   Fix size pane  #fixSizePanes    Morph icons  #morphIcons    Tags  #compoundTaggedTree    Updated selection  #listsWithUpdatedSelection    (no glmBrowser pragma) #singleInitialSelection
>
> [*4]     #sendTo:from:with:  ==>      #transmit:port:   ;  #from:  ;  #transformed

These is part of the change in the API. See above.


>   Updated selection  #listsWithUpdatedSelection
>
>
> [*6]      Transcript     ==>      Inspector    (not really a significant change?)

We have a rule in Moose to not use Transcript in the code :)



>   Action list  #simpleActionList [*3,6]
>   Menus  #staticAndDynamicMenu [*6]
>
>
>
> DOES NOT WORK IN 4.6
> #interdependentPanes - code is flagged as not working. does not work in 4.5 either.

Yes, this is still an enigma. Would love it if someone would take it by the horns :).


> FIXED IN 4.6, WAS NON-WORKING IN 4.5
> Double click #doubleClick
> #simpleTable
> #textPortsExamples
>
> #accumulator - Accumulator - looks like an example design change to separate concerns. Double clicking a number in the left pane, in the right pane brings up...
>   4.5 - number tab with sub-tabs 'List' & 'Text' as well as a connect-menu item 'Inspect'
>   4.6 - number tab only, no sub-tabs or context menu
>
> WORKS FROM EXAMPLE BROWSER BUT NOT FROM METHOD COMMENT
> #textSelection - execute from method comment works in 4.5 but fails in 4.6 with unknown selector
> #textSelectionInterval.

Thanks. I fixed it.


> OPERATES THE SAME - CODE DIFFERENCE AS NOTED
>
> Dashboard  #dashboard
> Dashboard specifying extents  #dashboardWithSpecificExtents
> Dashboards in dashboard  #dashboardsInDashboard
> Composite arrangements  #differentComposites
> Complex morphs (StarBrowser simulation)  #starBrowser
> EyeSee interactive bar chart  #eyeseeBarDiagram
> Mondrian painting  #mondrianPainting
> Multiple actions  #multipleActions
> Simple Expander  #simpleExpander
> Smart lists  #treeWithAmountFiltering
> Stacker  #stacker
> Tabs with different actions  #tabsWithDifferentActions
> Three inter-dependent panes  #threeInterdependentPanes
> Tree with children by level  #treeWithChildrenByLevel
> Tree with expansion  #treeWithExpansion
> (no glmBrowser pragma)    #taggedTree
>
> (no glmBrowser pragma) #multiInitialSelection [*1,3] - but I am only able to multi-select contiguous items with the SHIFT key.  I am unable to multi-select non-contiguous items as I would expect using the CTRL key.  Instead a context menu for MorphTreeMorph appears.   Is this unfortunate behaviour just me?

I noticed this, too. This is unfortunate only on Windows. For some reason we cannot use selective select. It would be great to get some help with the MorphTreeMorph.


> #magritte - This was one a was I was REALLY interested to see regarding the update to Magritte 3.  However the code is identical to 4.5.  Both 4.5 and 4.6 produce the same error....
> [Save] ==> error MAWriteError: Not supposed to write to something.
> [Cancel] ==> no change. Now without knowing anything about Magritte, I would expect the text box to revert to the original text.
> What would actually be a fantastic example here would be a small address book of a few entries that browsed a list in one pane and in another the magritte detail could be edited.

Thanks. At the moment, I just improved a bit the existing magritte example. I will try to enhance it a bit if I get some time.


> #tableWithIcons
>   4.6 also adds alternating icons.
>   4.5 broken & does not transmit to next pane, but same code to 4.6 does work.
>   selectionAct: [:tree | tree inspect ]  ==>  selectionAct: [:tree | tree selection inspect ]
>
>
>
> This has been improved in 4.6 to auto-expand when moving from [first tree] to [second tree]
> However in both 4.5 & 4.6, upon initial opening and when switching from [first tree] to [second tree] an erroneous additional line spacing occurs as shown in _ treeWithInitialSelection-extra-line-spacing.jpg _ (attached)

This is annoying indeed. It's a MorphTreeMorph feature again. I do not know how to fix it :(.



> #treeWithMenu - might need the same change to selectionAct: as for  #tableWithIcons
> #treeWithTags [*1]
>
> #treeWithTagsMoreLevels [*1] - it would be good if after deselecting the tags, it remembered which node had previously been expanded.  When when I click a tag twice, I expect to get back the same view I had before.

This is a tough one :)


> #updateableBrowser [*1] Completely different code and operation. What is the difference in operation between the 'Upadted automatically' tab and 'Updated via menu' -

The difference is that if you add an item in the collection using the + icon, it gets automatically added on the left, but on the right it appears only if you manually press refresh.


> #validator [*6]
> #validatorDynamic [*6] - but I don't actually see any difference to operation of #validator method - what am I missing ?

The validatorDynamic example uses a DynamicPresentation, while the simple validator uses a regular presentation.


> #wizard - it is not clear how to get the selected items

These parts of Glamour are work in progress.


Cheers,
Doru


--
www.tudorgirba.com

"Obvious things are difficult to teach."




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Glamour-Examples comparison 4.5 v 4.6 - Class GLMBasicExamples

Ben Coman
Tudor Girba wrote:

The GLMExamplesBrowser menu item [View browser tree] is interesting...
    

Thanks :)

You can learn a bit more about it here:
http://www.humane-assessment.com/stories/rogue-announcements/
  
Nice story.

  
NEW IN 4.6
Do the following demonstrate new functionality in 4.6 or just a new example of existing 4.5 functionality ?

#formatAsWords - what does this have to do with composites protocol? 
    

I do not understand the question. This example simply shows how you can use format to customize how each item gets displayed.
  
The third pane of System Browser shows 'protocols.'  GLMBasicExamples has a 'composite' protocol which includes the formatAsWords method, but I don't see what formatAsWords has to do with composites.
#magritte - This was one a was I was REALLY interested to see regarding the update to Magritte 3.  However the code is identical to 4.5.  Both 4.5 and 4.6 produce the same error....
[Save] ==> error MAWriteError: Not supposed to write to something.
[Cancel] ==> no change. Now without knowing anything about Magritte, I would expect the text box to revert to the original text.
What would actually be a fantastic example here would be a small address book of a few entries that browsed a list in one pane and in another the magritte detail could be edited.
    

Thanks. At the moment, I just improved a bit the existing magritte example. I will try to enhance it a bit if I get some time.
  
Where do I find this?
Very much looking forward to a further Glamour-Magritte example.

#validator [*6]
#validatorDynamic [*6] - but I don't actually see any difference to operation of #validator method - what am I missing ?
    

The validatorDynamic example uses a DynamicPresentation, while the simple validator uses a regular presentation.
  
So this shows two ways of doing the same thing?  Thats okay - but what advantage does DynamicPresentation have over a regular presentation, and is there an example demonstrating this?

Cheers,
Doru


--
www.tudorgirba.com

"Obvious things are difficult to teach."
  
"The funny thing about common-sense is that it is not so common"

cheers, -ben



_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Glamour-Examples comparison 4.5 v 4.6 - Class GLMBasicExamples

Tudor Girba-2
Hi,

On Thu, Mar 1, 2012 at 3:07 PM, Ben Coman <[hidden email]> wrote:

> #formatAsWords - what does this have to do with composites protocol?
>
>
> I do not understand the question. This example simply shows how you can use
> format to customize how each item gets displayed.
>
>
> The third pane of System Browser shows 'protocols.'  GLMBasicExamples has a
> 'composite' protocol which includes the formatAsWords method, but I don't
> see what formatAsWords has to do with composites.

Oh, I see now :). It's just a mistake.

> #magritte - This was one a was I was REALLY interested to see regarding the
> update to Magritte 3.  However the code is identical to 4.5.  Both 4.5 and
> 4.6 produce the same error....
> [Save] ==> error MAWriteError: Not supposed to write to something.
> [Cancel] ==> no change. Now without knowing anything about Magritte, I would
> expect the text box to revert to the original text.
> What would actually be a fantastic example here would be a small address
> book of a few entries that browsed a list in one pane and in another the
> magritte detail could be edited.
>
>
> Thanks. At the moment, I just improved a bit the existing magritte example.
> I will try to enhance it a bit if I get some time.
>
>
> Where do I find this?
> Very much looking forward to a further Glamour-Magritte example.

It's in the repository. You can also find it in the latest Moose dev
build, although this will be on Pharo 1.4:
http://ci.moosetechnology.org/job/moose-latest-dev/lastSuccessfulBuild/artifact/


> #validator [*6]
> #validatorDynamic [*6] - but I don't actually see any difference to
> operation of #validator method - what am I missing ?
>
> The validatorDynamic example uses a DynamicPresentation, while the simple
> validator uses a regular presentation.
>
>
> So this shows two ways of doing the same thing?  Thats okay - but what
> advantage does DynamicPresentation have over a regular presentation, and is
> there an example demonstrating this?

It's not about the advantage. It was simply to show that the validator
can handle dynamic presentations as well.

The dynamic presentation is covered briefly here:
http://www.themoosebook.org/book/internals/glamour/presentations/dynamic

Cheers,
Doru



--
www.tudorgirba.com

"Every thing has its own flow"

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Glamour/Magritte example Re: Re: Glamour-Examples comparison 4.5 v 4.6 - Class GLMBasicExamples

Ben Coman
Tudor Girba wrote:
Hi,

On Thu, Mar 1, 2012 at 3:07 PM, Ben Coman [hidden email] wrote:

  
#formatAsWords - what does this have to do with composites protocol?


I do not understand the question. This example simply shows how you can use
format to customize how each item gets displayed.


The third pane of System Browser shows 'protocols.'  GLMBasicExamples has a
'composite' protocol which includes the formatAsWords method, but I don't
see what formatAsWords has to do with composites.
    

Oh, I see now :). It's just a mistake.

  
#magritte - This was one a was I was REALLY interested to see regarding the
update to Magritte 3.  However the code is identical to 4.5.  Both 4.5 and
4.6 produce the same error....
[Save] ==> error MAWriteError: Not supposed to write to something.
[Cancel] ==> no change. Now without knowing anything about Magritte, I would
expect the text box to revert to the original text.
    
What would actually be a fantastic example here would be a small address
book of a few entries that browsed a list in one pane and in another the
magritte detail could be edited.


Thanks. At the moment, I just improved a bit the existing magritte example.
I will try to enhance it a bit if I get some time.


Where do I find this?
Very much looking forward to a further Glamour-Magritte example.
    

It's in the repository. You can also find it in the latest Moose dev
build, although this will be on Pharo 1.4:
http://ci.moosetechnology.org/job/moose-latest-dev/lastSuccessfulBuild/artifact/
  

Thanks Tudor.  I added having a list view and details pane (image attached) and uploaded to http://www.squeaksource.com/Glamour as Glamour-Examples-BenComan.227.  I hope you like it.  Those small number of lines are a testament to the power of both Glamour and Magritte, and a minor achievement in my learning of them.  Things are slowly falling into place.

However I've broken starting it from the examples browser, so use the method comment - and hopefully the fix is obvious to you since I could not work it out.
Also as I mentioned above, the <Cancel> button does not perform as I expect, which would be to revert back to the original data.

cheers, Ben



_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

GlamourMagritteExample(1).png (17K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Glamour/Magritte example Re: Re: Glamour-Examples comparison 4.5 v 4.6 - Class GLMBasicExamples

Tudor Girba-2
Hi Ben,


On 1 Mar 2012, at 19:08, Ben Coman wrote:

>>> Very much looking forward to a further Glamour-Magritte example.
>>>    
>>>
>>
>> It's in the repository. You can also find it in the latest Moose dev
>> build, although this will be on Pharo 1.4:
>>
>> http://ci.moosetechnology.org/job/moose-latest-dev/lastSuccessfulBuild/artifact/
>
> Thanks Tudor.  I added having a list view and details pane (image attached) and uploaded to http://www.squeaksource.com/Glamour as Glamour-Examples-BenComan.227.  I hope you like it.  Those small number of lines are a testament to the power of both Glamour and Magritte, and a minor achievement in my learning of them.  Things are slowly falling into place.

Excellent.

> However I've broken starting it from the examples browser, so use the method comment - and hopefully the fix is obvious to you since I could not work it out.

But, it does work already :). My guess is that you tried to work from an opened examples browser, but the current implementation does not reload the code of the pragma (which means that you were probably running the new code with the old setup).

Anyway, if you start a new examples browser it will work as expected. Nice job.

> Also as I mentioned above, the <Cancel> button does not perform as I expect, which would be to revert back to the original data.

Indeed, this is a good point. Would you like to give it a try to fix this? If you need help, just ask and I try to answer. Like that you learn the internals of Glamour (they are not that complicated)

The relevant code is in:
- GLMMagrittePresentation
- GLMMorphicMagritteRenderer

Cheers,
Doru



> cheers, Ben
>
>
> <GlamourMagritteExample(1).png>_______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"One cannot do more than one can do."




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Glamour/Magritte example Re: Re: Glamour-Examples comparison 4.5 v 4.6 - Class GLMBasicExamples

Ben Coman
Tudor Girba wrote:
Hi Ben,


On 1 Mar 2012, at 19:08, Ben Coman wrote:

  
Very much looking forward to a further Glamour-Magritte example.
    

        
It's in the repository. You can also find it in the latest Moose dev
build, although this will be on Pharo 1.4:

http://ci.moosetechnology.org/job/moose-latest-dev/lastSuccessfulBuild/artifact/
      
Thanks Tudor.  I added having a list view and details pane (image attached) and uploaded to http://www.squeaksource.com/Glamour as Glamour-Examples-BenComan.227.  I hope you like it.  Those small number of lines are a testament to the power of both Glamour and Magritte, and a minor achievement in my learning of them.  Things are slowly falling into place.
    

Excellent.

  
However I've broken starting it from the examples browser, so use the method comment - and hopefully the fix is obvious to you since I could not work it out.
    

But, it does work already :). My guess is that you tried to work from an opened examples browser, but the current implementation does not reload the code of the pragma (which means that you were probably running the new code with the old setup).
  
You are right. It works in a newly opened examples browser.
Anyway, if you start a new examples browser it will work as expected. Nice job.

  
Also as I mentioned above, the <Cancel> button does not perform as I expect, which would be to revert back to the original data.
    

Indeed, this is a good point. Would you like to give it a try to fix this? If you need help, just ask and I try to answer. Like that you learn the internals of Glamour (they are not that complicated)

The relevant code is in:
- GLMMagrittePresentation
- GLMMorphicMagritteRenderer
  
I've just woken up and off to work. I will try tonight.
Cheers,
Doru



  
cheers, Ben


<GlamourMagritteExample(1).png>_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
    

--
www.tudorgirba.com

"One cannot do more than one can do."




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

  


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Glamour/Magritte example Re: Re: Glamour-Examples comparison 4.5 v 4.6 - Class GLMBasicExamples

Ben Coman
Ben Coman wrote:

> Tudor Girba wrote:
> > Hi Ben,
> >
> >
> > On 1 Mar 2012, at 19:08, Ben Coman wrote:
> >
> >  
> >>>> Very much looking forward to a further Glamour-Magritte example.
> >>>>    
> >>>>
> >>>>        
> >>> It's in the repository. You can also find it in the latest Moose dev
> >>> build, although this will be on Pharo 1.4:
> >>>
> >>> http://ci.moosetechnology.org/job/moose-latest-dev/lastSuccessfulBuild/artifact/
> >>>      
> >> Thanks Tudor.  I added having a list view and details pane (image attached) and uploaded to http://www.squeaksource.com/Glamour as Glamour-Examples-BenComan.227.  I hope you like it.  Those small number of lines are a testament to the power of both Glamour and Magritte, and a minor achievement in my learning of them.  Things are slowly falling into place.
> >>    
> >
> > Excellent.
> >
> >  
> >> However I've broken starting it from the examples browser, so use the method comment - and hopefully the fix is obvious to you since I could not work it out.
> >>    
> >
> > But, it does work already :). My guess is that you tried to work from an opened examples browser, but the current implementation does not reload the code of the pragma (which means that you were probably running the new code with the old setup).
> >  
> You are right. It works in a newly opened examples browser.
> > Anyway, if you start a new examples browser it will work as expected. Nice job.
> >
> >  
> >> Also as I mentioned above, the <Cancel> button does not perform as I expect, which would be to revert back to the original data.
> >>    
> >
> > Indeed, this is a good point. Would you like to give it a try to fix this? If you need help, just ask and I try to answer. Like that you learn the internals of Glamour (they are not that complicated)
> >
> > The relevant code is in:
> > - GLMMagrittePresentation
> > - GLMMorphicMagritteRenderer
>  
Some help would be appreciated.  I would like to use this to browse and
modify some electrical power data for my Master project. I've spent
about 10 hours at it and has some success, but need a more experienced
eye to look it over.   I documented my investigation in detail (if a bit
scrappy) since this forced me to consider each part separately and did
help improve my understanding of the system.  Perhaps it even might be a
good walk through for other.

There is a second problem to the one above.  The <save> button does work
okay such that I change change person and back again and any change I
made remains.  However a change to the Name attribute in the #details
pane is not reflected in the #list pane.  I tried to track this down as
well.   I was having trouble determining which object were copies or not
so I added the following code to the example...
----------------
Object subclass: #GLMMagrittePersonExample
    instanceVariableNames: 'name address'
    classVariableNames: 'Sample1'
    poolDictionaries: ''
    category: 'Glamour-Examples'

GLMMagrittePersonExample>>sample1
    Sample1 ifNil:
    [
        Sample1 := OrderedCollection new.
        Sample1 add: (GLMMagrittePersonExample new name: 'William
Shakespeare' ; address: 'Stratford-upon-Avon' ).
        Sample1 add: (GLMMagrittePersonExample new name: 'Victor Hugo' ;
address: 'Besançon' ).
        Sample1 add: (GLMMagrittePersonExample new name: 'Mark Twain' ;
address: 'Florida' ).
        Sample1 add: (GLMMagrittePersonExample new name: 'Banjo
Paterson' ; address: 'Narrambla' ).
    ].
    ^Sample1

GLMMagrittePersonExample>>identityInSample1
    ^ self class sample1 includes: self.

GLMMagrittePersonExample>>printOn: aStream
    aStream nextPutAll: '('.
    self name printOn: aStream.
    aStream nextPutAll: ','.
    self address printOn: aStream.
    aStream nextPutAll: ')'.
    self identityInSample1
        ifTrue: [ aStream nextPutAll: ' #original# ']
        ifFalse: [ aStream nextPutAll: ' #copy# '].
    super printOn: aStream.  

-------------------
Now for reference below, here is GLMBasicExamples>>magritte
001 magritte
002     <glmBrowser: 'Magritte presentation' input:
'GLMMagrittePersonExample sample1'>
003     "self new magritte openOn: GLMMagrittePersonExample sample1"
004     | browser |
005     browser := GLMTabulator new.
006     browser column: #list; column: #detail.
007     browser transmit to: #list ; andShow: [ :a |
008         self halt.
009         a list
010             format: [ :aPerson | self halt. aPerson name ] ].
011     browser transmit from: #list ; to: #detail ; andShow: [ :a |
012         self halt.
013         a magritte
014             title: 'Details';
015             act: [:magritte | self halt. magritte entity explore ]
016                 icon: GLMUIThemeExtraIcons glamorousInspect
017                 entitled: 'Explore';
018             description: [:aPerson | self halt. aPerson
magritteDescription] ].
019     ^ browser

I was having trouble following what was happening, so I went overboard
and put a 'self halt' at the start of EVERY method and block associated
with GLMMagrittePresentation & GLMMorphicMagritteRenderer, so then...

(1) From Workspace... <DoIt> GLMBasicExamples new magritte openOn:
GLMMagrittePersonExample sample1

(2)  hits the first halt in line 008.
    This stores the block from line 010 used later in (5)

(3) <Proceed> to the halt in line 012.
    This stores the blocks on lines 015 & 018 for later use.

(4) <Proceed> to the halt in #GLMMagrittePresentation>>description: .
    This just stores a block into ivar  magritteDescription for later use.

(5)  <Proceed> to the halt on line 010 where the four data values for
the #list pane are being readied for display.
    Here aPerson is #original#.

(6) <Proceed> four times to...

update the display with Glamorous Browser appearing with four items in
#list pane and the #details pane blank.

(7) Clicking on a data item proceeds to the halt in
GLMMagrittePresentation>>renderGlamorouslyOn:
    At the bottom of the call stack I see the very first call after
MessageSend>>valueWithArguments is
GLMMorphicPaneRenderer>>actOnMatchingPresentationChanged and that its
parameter anAnnouncement is aGLMMatchingPresentationsChanged (pane = a
GLMPane(386924544 detail)).  I don't really understand announcements yet
but I wonder if I need to somehow to fire off a similar announcement to
refresh the display after I press the <cancel> button.

(8) <Proceed> to halt in GLMMorphicMagritteRenderer>>render
    This is actually only a few debug-steps on from (7)  we have (
aMagrittePresentation on: GLMPresentationUpdated send:
#actOnPresentationUpdated: to: self.)
    and I wonder if this needs to match (7) ????

(9) <Proceed> to halt in GLMMorphicMagritteRenderer>>magritteMorphFrom:
    This is actually only a few debug-steps on from (8).
    toShow:= is #original#. This was a surprise (I'm not sure why) but
is a good sign.
    Stepping through the line description:= leads directly (10) or
alternatively...

(10) <Proceed> to the halt in GLMMagrittePresentation>>magritteDescription.
        This returns the block [:aPerson | self halt. aPerson
magritteDescription] stored by (3) from line 018
        Stepping through the evaluation of the block leads to (11),
alternatively...

(11) <Proceed> to the halt in line 018.
    Here aPerson is still #original#

(9b) Continuing to step through returns to
GLMMorphicMagritteRenderer>>magritteMorphFrom:
    Inspecting magritteDescriptionMorph after it is assigned shows it
contains a memento, that when inspected (and left open which I shall
refer to as memento1) shows instant variables

        memento1.model = ('William Shakespeare','Stratford-upon-Avon')
#original# a GLMMagrittePersonExample
    It is interesting that I can now see the #original# has carried
through to this point.   I had assumed that some of my non-update
problems had been to do with operating on copies of copies.

       memento1.cache = copies of each attribute of
GLMMagrittePersonExample as
                (a MAStringDescription label: 'Name' comment:
nil->'William Shakespeare')
                (a MAStringDescription label: 'Address' comment:
nil->'Stratford-upon-Avon')

       memento1.original = copies of each attribute of
GLMMagrittePersonExample
                (a MAStringDescription label: 'Name' comment:
nil->'William Shakespeare')
                (a MAStringDescription label: 'Address' comment:
nil->'Stratford-upon-Avon')

(12) At any point you can <Proceed> to...

update the display with the #details pane filled in.

(13) Altering the Name attribute to be 'xxxxxx' (and saving with
<ctrl-s>) I observe
        memento1.cache has changed to (a MAStringDescription label:
'Name' comment: nil->'xxxxxx')
        with no change in memento1.model or memento1.original.

(14) Then clicking <cancel> proceeds to the halt in
GLMMagrittePresentation>reactOnAnswerFor:
    Looking one level back up the call stack I see that this is called
from the block stored by #onAnswer: in GLMMorphicMagritteRenderer.  I
think this is where the code might need changing.

    GLMMagrittePresentation>reactOnAnswerFor: doesn't seem to do stuff
all.  It just returns some data, which if you follow through to the when
the debugger closes, seems to just get thrown away.

    Prior to this point, memento1.cache has already changed back to (a
MAStringDescription label: 'Name' comment: nil->'William Shakespeare').
    This would appear to have occurred several level back up the call
stack in MASilentContainerMorph>>cancel with a (self reset)
    So it would seem that we just need to notify the display to redraw.

    GLMMagrittePresentation>reactOnAnswerFor: has self of (a
GLMMagrittePresentation(id=685506560 title=Details pane=a
GLMPane(386924544 detail)))
    which matches the pane from (7).  If I use World > Tools > Finder to
search source for 'GLMMatchingPresentationsChanged' I find
GLMMorphicPaneRenderer>>render:
    which has aPane on: GLMMatchingPresentationsChanged send:
#actOnMatchingPresentationChanged: to: self.

    so in the debugger I went to try...
         pane on: GLMMatchingPresentationsChanged  send:
#actOnMatchingPresentationChanged: to: XXXX.
    but I could not work out what XXXX should be since it seemed like it
should be the renderer and I did not have that here.

    But then looking around some more I see the parent class
GLMPresentation has method 'update'
    so from the debugger 'self update' returned the display to show
'William Shakespeare'.

So inthe end I added 'self update' to the start of
GLMMagrittePresentation>>reactOnAnswerFor:  as follows...
reactOnAnswerFor:  aValue
    self update.
    ^ answerBlock glamourValue:
        (aValue asGlamorousMultiValue,
        self asGlamorousMultiValue,
        self entity asGlamorousMultiValue)

and now the <cancel> button works as expected.  However I still don't
know what reactOnAnswerFor is meant to do, or if there
is a more appropriate way of achieving this.  Please let me know.

I also haven't had any success getting the #list pane to refresh when a
change is saved on the #detail pane.  Any assistance will be greatly
appreciated.

cheers, -ben



_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Glamour/Magritte example Re: Re: Glamour-Examples comparison 4.5 v 4.6 - Class GLMBasicExamples

Tudor Girba-2
Hi Ben,

It is too difficult to look at the code like this. Could you provide the code in some repository?

Cheers,
Doru


On 5 Mar 2012, at 17:59, Ben Coman wrote:

> Ben Coman wrote:
>> Tudor Girba wrote:
>> > Hi Ben,
>> >
>> >
>> > On 1 Mar 2012, at 19:08, Ben Coman wrote:
>> >
>> >   >>>> Very much looking forward to a further Glamour-Magritte example.
>> >>>>     >>>>
>> >>>>         >>> It's in the repository. You can also find it in the latest Moose dev
>> >>> build, although this will be on Pharo 1.4:
>> >>>
>> >>> http://ci.moosetechnology.org/job/moose-latest-dev/lastSuccessfulBuild/artifact/
>> >>>       >> Thanks Tudor.  I added having a list view and details pane (image attached) and uploaded to http://www.squeaksource.com/Glamour as Glamour-Examples-BenComan.227.  I hope you like it.  Those small number of lines are a testament to the power of both Glamour and Magritte, and a minor achievement in my learning of them.  Things are slowly falling into place.
>> >>     >
>> > Excellent.
>> >
>> >   >> However I've broken starting it from the examples browser, so use the method comment - and hopefully the fix is obvious to you since I could not work it out.
>> >>     >
>> > But, it does work already :). My guess is that you tried to work from an opened examples browser, but the current implementation does not reload the code of the pragma (which means that you were probably running the new code with the old setup).
>> >   You are right. It works in a newly opened examples browser.
>> > Anyway, if you start a new examples browser it will work as expected. Nice job.
>> >
>> >   >> Also as I mentioned above, the <Cancel> button does not perform as I expect, which would be to revert back to the original data.
>> >>     >
>> > Indeed, this is a good point. Would you like to give it a try to fix this? If you need help, just ask and I try to answer. Like that you learn the internals of Glamour (they are not that complicated)
>> >
>> > The relevant code is in:
>> > - GLMMagrittePresentation
>> > - GLMMorphicMagritteRenderer
>>  
> Some help would be appreciated.  I would like to use this to browse and modify some electrical power data for my Master project. I've spent about 10 hours at it and has some success, but need a more experienced eye to look it over.   I documented my investigation in detail (if a bit scrappy) since this forced me to consider each part separately and did help improve my understanding of the system.  Perhaps it even might be a good walk through for other.
>
> There is a second problem to the one above.  The <save> button does work okay such that I change change person and back again and any change I made remains.  However a change to the Name attribute in the #details pane is not reflected in the #list pane.  I tried to track this down as well.   I was having trouble determining which object were copies or not so I added the following code to the example...
> ----------------
> Object subclass: #GLMMagrittePersonExample
>   instanceVariableNames: 'name address'
>   classVariableNames: 'Sample1'
>   poolDictionaries: ''
>   category: 'Glamour-Examples'
>
> GLMMagrittePersonExample>>sample1
>   Sample1 ifNil:
>   [
>       Sample1 := OrderedCollection new.
>       Sample1 add: (GLMMagrittePersonExample new name: 'William Shakespeare' ; address: 'Stratford-upon-Avon' ).
>       Sample1 add: (GLMMagrittePersonExample new name: 'Victor Hugo' ; address: 'Besançon' ).
>       Sample1 add: (GLMMagrittePersonExample new name: 'Mark Twain' ; address: 'Florida' ).
>       Sample1 add: (GLMMagrittePersonExample new name: 'Banjo Paterson' ; address: 'Narrambla' ).
>   ].
>   ^Sample1
>
> GLMMagrittePersonExample>>identityInSample1
>   ^ self class sample1 includes: self.
>
> GLMMagrittePersonExample>>printOn: aStream
>   aStream nextPutAll: '('.
>   self name printOn: aStream.
>   aStream nextPutAll: ','.
>   self address printOn: aStream.
>   aStream nextPutAll: ')'.
>   self identityInSample1
>       ifTrue: [ aStream nextPutAll: ' #original# ']
>       ifFalse: [ aStream nextPutAll: ' #copy# '].
>   super printOn: aStream.  
> -------------------
> Now for reference below, here is GLMBasicExamples>>magritte
> 001 magritte
> 002     <glmBrowser: 'Magritte presentation' input: 'GLMMagrittePersonExample sample1'>
> 003     "self new magritte openOn: GLMMagrittePersonExample sample1"
> 004     | browser |
> 005     browser := GLMTabulator new.
> 006     browser column: #list; column: #detail.
> 007     browser transmit to: #list ; andShow: [ :a |
> 008         self halt.
> 009         a list
> 010             format: [ :aPerson | self halt. aPerson name ] ].
> 011     browser transmit from: #list ; to: #detail ; andShow: [ :a |
> 012         self halt.
> 013         a magritte
> 014             title: 'Details';
> 015             act: [:magritte | self halt. magritte entity explore ]
> 016                 icon: GLMUIThemeExtraIcons glamorousInspect
> 017                 entitled: 'Explore';
> 018             description: [:aPerson | self halt. aPerson magritteDescription] ].
> 019     ^ browser
>
> I was having trouble following what was happening, so I went overboard and put a 'self halt' at the start of EVERY method and block associated with GLMMagrittePresentation & GLMMorphicMagritteRenderer, so then...
> (1) From Workspace... <DoIt> GLMBasicExamples new magritte openOn: GLMMagrittePersonExample sample1
>
> (2)  hits the first halt in line 008.
>   This stores the block from line 010 used later in (5)
>
> (3) <Proceed> to the halt in line 012.
>   This stores the blocks on lines 015 & 018 for later use.
>
> (4) <Proceed> to the halt in #GLMMagrittePresentation>>description: .
>   This just stores a block into ivar  magritteDescription for later use.
>
> (5)  <Proceed> to the halt on line 010 where the four data values for the #list pane are being readied for display.    Here aPerson is #original#.
>
> (6) <Proceed> four times to...
>
> update the display with Glamorous Browser appearing with four items in #list pane and the #details pane blank.
> (7) Clicking on a data item proceeds to the halt in GLMMagrittePresentation>>renderGlamorouslyOn:
>   At the bottom of the call stack I see the very first call after MessageSend>>valueWithArguments is GLMMorphicPaneRenderer>>actOnMatchingPresentationChanged and that its parameter anAnnouncement is aGLMMatchingPresentationsChanged (pane = a GLMPane(386924544 detail)).  I don't really understand announcements yet but I wonder if I need to somehow to fire off a similar announcement to refresh the display after I press the <cancel> button.
>
> (8) <Proceed> to halt in GLMMorphicMagritteRenderer>>render
>   This is actually only a few debug-steps on from (7)  we have ( aMagrittePresentation on: GLMPresentationUpdated send: #actOnPresentationUpdated: to: self.)
>   and I wonder if this needs to match (7) ????
>
> (9) <Proceed> to halt in GLMMorphicMagritteRenderer>>magritteMorphFrom:
>   This is actually only a few debug-steps on from (8).
>   toShow:= is #original#. This was a surprise (I'm not sure why) but is a good sign.
>   Stepping through the line description:= leads directly (10) or alternatively...
>
> (10) <Proceed> to the halt in GLMMagrittePresentation>>magritteDescription.
>       This returns the block [:aPerson | self halt. aPerson magritteDescription] stored by (3) from line 018
>       Stepping through the evaluation of the block leads to (11), alternatively...
>
> (11) <Proceed> to the halt in line 018.
>   Here aPerson is still #original#
>
> (9b) Continuing to step through returns to GLMMorphicMagritteRenderer>>magritteMorphFrom:
>   Inspecting magritteDescriptionMorph after it is assigned shows it contains a memento, that when inspected (and left open which I shall refer to as memento1) shows instant variables
>
>       memento1.model = ('William Shakespeare','Stratford-upon-Avon') #original# a GLMMagrittePersonExample
>   It is interesting that I can now see the #original# has carried through to this point.   I had assumed that some of my non-update problems had been to do with operating on copies of copies.
>
>      memento1.cache = copies of each attribute of GLMMagrittePersonExample as
>               (a MAStringDescription label: 'Name' comment: nil->'William Shakespeare')
>               (a MAStringDescription label: 'Address' comment: nil->'Stratford-upon-Avon')
>
>      memento1.original = copies of each attribute of GLMMagrittePersonExample
>               (a MAStringDescription label: 'Name' comment: nil->'William Shakespeare')
>               (a MAStringDescription label: 'Address' comment: nil->'Stratford-upon-Avon')
>
> (12) At any point you can <Proceed> to...
>
> update the display with the #details pane filled in.
>
> (13) Altering the Name attribute to be 'xxxxxx' (and saving with <ctrl-s>) I observe
>       memento1.cache has changed to (a MAStringDescription label: 'Name' comment: nil->'xxxxxx')
>       with no change in memento1.model or memento1.original.
>
> (14) Then clicking <cancel> proceeds to the halt in GLMMagrittePresentation>reactOnAnswerFor:
>   Looking one level back up the call stack I see that this is called from the block stored by #onAnswer: in GLMMorphicMagritteRenderer.  I think this is where the code might need changing.
>
>   GLMMagrittePresentation>reactOnAnswerFor: doesn't seem to do stuff all.  It just returns some data, which if you follow through to the when the debugger closes, seems to just get thrown away.
>
>   Prior to this point, memento1.cache has already changed back to (a MAStringDescription label: 'Name' comment: nil->'William Shakespeare').
>   This would appear to have occurred several level back up the call stack in MASilentContainerMorph>>cancel with a (self reset)
>   So it would seem that we just need to notify the display to redraw.
>
>   GLMMagrittePresentation>reactOnAnswerFor: has self of (a GLMMagrittePresentation(id=685506560 title=Details pane=a GLMPane(386924544 detail)))
>   which matches the pane from (7).  If I use World > Tools > Finder to search source for 'GLMMatchingPresentationsChanged' I find GLMMorphicPaneRenderer>>render:
>   which has aPane on: GLMMatchingPresentationsChanged send: #actOnMatchingPresentationChanged: to: self.
>
>   so in the debugger I went to try...
>        pane on: GLMMatchingPresentationsChanged  send: #actOnMatchingPresentationChanged: to: XXXX.
>   but I could not work out what XXXX should be since it seemed like it should be the renderer and I did not have that here.
>
>   But then looking around some more I see the parent class GLMPresentation has method 'update'
>   so from the debugger 'self update' returned the display to show 'William Shakespeare'.
>
> So inthe end I added 'self update' to the start of GLMMagrittePresentation>>reactOnAnswerFor:  as follows...
> reactOnAnswerFor:  aValue
>   self update.
>   ^ answerBlock glamourValue:
>       (aValue asGlamorousMultiValue,
>       self asGlamorousMultiValue,
>       self entity asGlamorousMultiValue)
>
> and now the <cancel> button works as expected.  However I still don't know what reactOnAnswerFor is meant to do, or if there
> is a more appropriate way of achieving this.  Please let me know.
>
> I also haven't had any success getting the #list pane to refresh when a change is saved on the #detail pane.  Any assistance will be greatly appreciated.
>
> cheers, -ben
>
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"Every thing should have the right to be different."




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Glamour/Magritte example Re: Re: Glamour-Examples comparison 4.5 v 4.6 - Class GLMBasicExamples

Ben Coman
In reply to this post by Ben Coman
Ben Coman wrote:
8<----cut-------

> So in the end I added 'self update' to the start of
> GLMMagrittePresentation>>reactOnAnswerFor:  as follows...
> reactOnAnswerFor:  aValue
>    self update.
>    ^ answerBlock glamourValue:
>        (aValue asGlamorousMultiValue,
>        self asGlamorousMultiValue,
>        self entity asGlamorousMultiValue)
>
> and now the <cancel> button works as expected.  However I still don't
> know what reactOnAnswerFor is meant to do, or if there
> is a more appropriate way of achieving this.  Please let me know.
>
> I also haven't had any success getting the #list pane to refresh when
> a change is saved on the #detail pane.  Any assistance will be greatly
> appreciated.
>
> cheers, -ben
>
Phew! That was a lot to take in.   Upon further investigation I retract
modifying GLMMagrittePresentation.
The solution to both the <save> and <cancel> buttons can be encompassed
entirely within the user code with one additional line 'onAnswer:'

    magritteParentPrototype := a magritte.
        magritteParentPrototype     "these are the essential parts"
            title: 'Details';
            description: [:person | person magritteDescription] ;
            onAnswer: [ :ignore | browser update ] .

I have uploaded this as Glamour-Examples-BenComan.230

Note that I think this only worked for me last time when I had
MagritteMagic loaded onto Moose 4.6.

cheers, Ben


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev