Hi, I'm making some progress here... but now I need another feature. As I'm using glamour and magritte to present some data who is persistent, I need to being able to react to a #save call on a magritte presentation. For instance... in my browser:
... browser transmit to: #detail; from: #list; andShow: [ :presenter | presenter magritte title: [ :anItem | anItem asString ]; act: [ :presentation :anItem | self removeItem: anItem ] icon: LWUIIcons / #userTrash entitled: 'Borrar' ]. ...
how can I know if user pressed #save and there is a modified object there? (to update persistent repository) working with plain magritte, I'd do:
... anObject asMorph onAnswer: [ :value | blah, blah ]; morph. ...
...so... is there a way in glamour to react to updated objects?
cheers, Esteban
Hi,
Unfortunately, the Magritte support is not quite what it could be. Your use case sounds quite reasonable, but it is not yet supported.
Perhaps we can just add GLMMagrittePresentation>>onAnswer:
and have the renderer use this.
Cheers, Doru
On Sep 15, 2011, at 14:54, Esteban Lorenzano estebanlm@gmail.com wrote:
Hi, I'm making some progress here... but now I need another feature. As I'm using glamour and magritte to present some data who is persistent, I need to being able to react to a #save call on a magritte presentation. For instance... in my browser:
... browser transmit to: #detail; from: #list; andShow: [ :presenter | presenter magritte title: [ :anItem | anItem asString ]; act: [ :presentation :anItem | self removeItem: anItem ] icon: LWUIIcons / #userTrash entitled: 'Borrar' ]. ...
how can I know if user pressed #save and there is a modified object there? (to update persistent repository) working with plain magritte, I'd do:
... anObject asMorph onAnswer: [ :value | blah, blah ]; morph. ...
...so... is there a way in glamour to react to updated objects?
cheers, Esteban _______________________________________________ Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Shouldn't onAnswer: just trigger the outgoing default port of the Magritte presentation/pane/...?
Lukas
On 15 September 2011 15:07, Tudor Girba tudor@tudorgirba.com wrote:
Hi,
Unfortunately, the Magritte support is not quite what it could be. Your use case sounds quite reasonable, but it is not yet supported.
Perhaps we can just add GLMMagrittePresentation>>onAnswer:
and have the renderer use this.
Cheers, Doru
On Sep 15, 2011, at 14:54, Esteban Lorenzano estebanlm@gmail.com wrote:
Hi, I'm making some progress here... but now I need another feature. As I'm using glamour and magritte to present some data who is persistent, I need to being able to react to a #save call on a magritte presentation. For instance... in my browser:
... browser transmit to: #detail; from: #list; andShow: [ :presenter | presenter magritte title: [ :anItem | anItem asString ]; act: [ :presentation :anItem | self removeItem: anItem ] icon: LWUIIcons / #userTrash entitled: 'Borrar' ]. ...
how can I know if user pressed #save and there is a modified object there? (to update persistent repository) working with plain magritte, I'd do:
... anObject asMorph onAnswer: [ :value | blah, blah ]; morph. ...
...so... is there a way in glamour to react to updated objects?
cheers, Esteban _______________________________________________ Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
uh? how so?
El 15/09/2011, a las 10:23a.m., Lukas Renggli escribió:
Shouldn't onAnswer: just trigger the outgoing default port of the Magritte presentation/pane/...?
Lukas
On 15 September 2011 15:07, Tudor Girba tudor@tudorgirba.com wrote:
Hi,
Unfortunately, the Magritte support is not quite what it could be. Your use case sounds quite reasonable, but it is not yet supported.
Perhaps we can just add GLMMagrittePresentation>>onAnswer:
and have the renderer use this.
Cheers, Doru
On Sep 15, 2011, at 14:54, Esteban Lorenzano estebanlm@gmail.com wrote:
Hi, I'm making some progress here... but now I need another feature. As I'm using glamour and magritte to present some data who is persistent, I need to being able to react to a #save call on a magritte presentation. For instance... in my browser:
... browser transmit to: #detail; from: #list; andShow: [ :presenter | presenter magritte title: [ :anItem | anItem asString ]; act: [ :presentation :anItem | self removeItem: anItem ] icon: LWUIIcons / #userTrash entitled: 'Borrar' ]. ...
how can I know if user pressed #save and there is a modified object there? (to update persistent repository) working with plain magritte, I'd do:
... anObject asMorph onAnswer: [ :value | blah, blah ]; morph. ...
...so... is there a way in glamour to react to updated objects?
cheers, Esteban _______________________________________________ Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- Lukas Renggli www.lukas-renggli.ch
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
One trick that I do in AspectMaps to notify updates (going around glamour limitations) is to use announcements. For example I send an event whenever the underlying model has changed:
self announcer announce: (AMModelChanged new).
I force a refresh of the pane when this happens using the code below. You could do the same: send an event when the #save call is made ...
browser transmit to: #mpanel; from: ... ; andShow: [:a | a mondrian painting: [ ...]; updateOn: AMModelChanged from: [:ent | self announcer ]].
On 15 Sep 2011, at 09:54, Esteban Lorenzano wrote:
Hi, I'm making some progress here... but now I need another feature. As I'm using glamour and magritte to present some data who is persistent, I need to being able to react to a #save call on a magritte presentation. For instance... in my browser:
... browser transmit to: #detail; from: #list; andShow: [ :presenter | presenter magritte title: [ :anItem | anItem asString ]; act: [ :presentation :anItem | self removeItem: anItem ] icon: LWUIIcons / #userTrash entitled: 'Borrar' ]. ...
how can I know if user pressed #save and there is a modified object there? (to update persistent repository) working with plain magritte, I'd do:
... anObject asMorph onAnswer: [ :value | blah, blah ]; morph. ...
...so... is there a way in glamour to react to updated objects?
cheers, Esteban _______________________________________________ Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
---> Save our in-boxes! http://emailcharter.org <---
Johan Fabry jfabry@dcc.uchile.cl - http://dcc.uchile.cl/~jfabry PLEIAD Lab - Computer Science Department (DCC) - University of Chile
yes... I also can use
presenter morph
instead
presenter magritte
but I think glamour deserves a better way, IMHO... as Doru said, this is a very common pattern, so it should be an easy way to perform it...
cheers, Esteban
El 15/09/2011, a las 11:12a.m., Johan Fabry escribió:
One trick that I do in AspectMaps to notify updates (going around glamour limitations) is to use announcements. For example I send an event whenever the underlying model has changed:
self announcer announce: (AMModelChanged new).
I force a refresh of the pane when this happens using the code below. You could do the same: send an event when the #save call is made ...
browser transmit to: #mpanel; from: ... ; andShow: [:a | a mondrian painting: [ ...]; updateOn: AMModelChanged from: [:ent | self announcer ]].
On 15 Sep 2011, at 09:54, Esteban Lorenzano wrote:
Hi, I'm making some progress here... but now I need another feature. As I'm using glamour and magritte to present some data who is persistent, I need to being able to react to a #save call on a magritte presentation. For instance... in my browser:
... browser transmit to: #detail; from: #list; andShow: [ :presenter | presenter magritte title: [ :anItem | anItem asString ]; act: [ :presentation :anItem | self removeItem: anItem ] icon: LWUIIcons / #userTrash entitled: 'Borrar' ]. ...
how can I know if user pressed #save and there is a modified object there? (to update persistent repository) working with plain magritte, I'd do:
... anObject asMorph onAnswer: [ :value | blah, blah ]; morph. ...
...so... is there a way in glamour to react to updated objects?
cheers, Esteban _______________________________________________ Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
---> Save our in-boxes! http://emailcharter.org <---
Johan Fabry jfabry@dcc.uchile.cl - http://dcc.uchile.cl/~jfabry PLEIAD Lab - Computer Science Department (DCC) - University of Chile
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
for instance, this:
browser transmit to: #detail; from: #list; andShow: [ :presenter | presenter morph title: [ :anItem | anItem asString ]; act: [ :presentation :anItem | self removeItem: anItem ] icon: LWUIIcons / #delete entitled: 'Borrar'; display: [ :anItem | (self magritteDescription asMorphOn: anItem) addButtons: #(save); onAnswer: [ :value | self updateItem: value ]; morph ] ].
...does exactly what I need... so... I don't need to use the magritte presentation at all... I know. But... it shouldn't have an option to do this? otherwise, I think is not useful at all, for certain scenaries (and we should stuck with morph presentation) :(
El 15/09/2011, a las 11:12a.m., Johan Fabry escribió:
One trick that I do in AspectMaps to notify updates (going around glamour limitations) is to use announcements. For example I send an event whenever the underlying model has changed:
self announcer announce: (AMModelChanged new).
I force a refresh of the pane when this happens using the code below. You could do the same: send an event when the #save call is made ...
browser transmit to: #mpanel; from: ... ; andShow: [:a | a mondrian painting: [ ...]; updateOn: AMModelChanged from: [:ent | self announcer ]].
On 15 Sep 2011, at 09:54, Esteban Lorenzano wrote:
Hi, I'm making some progress here... but now I need another feature. As I'm using glamour and magritte to present some data who is persistent, I need to being able to react to a #save call on a magritte presentation. For instance... in my browser:
... browser transmit to: #detail; from: #list; andShow: [ :presenter | presenter magritte title: [ :anItem | anItem asString ]; act: [ :presentation :anItem | self removeItem: anItem ] icon: LWUIIcons / #userTrash entitled: 'Borrar' ]. ...
how can I know if user pressed #save and there is a modified object there? (to update persistent repository) working with plain magritte, I'd do:
... anObject asMorph onAnswer: [ :value | blah, blah ]; morph. ...
...so... is there a way in glamour to react to updated objects?
cheers, Esteban _______________________________________________ Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
---> Save our in-boxes! http://emailcharter.org <---
Johan Fabry jfabry@dcc.uchile.cl - http://dcc.uchile.cl/~jfabry PLEIAD Lab - Computer Science Department (DCC) - University of Chile
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Hi,
I added the ability to provide onAnswer to a MagrittePresentation. Update to the latest packages and then try the following snippet:
collection := OrderedCollection new. browser := GLMTabulator new. browser column: #collection; column: #form. browser transmit to: #collection; andShow: [:a | a list display: collection ]. browser transmit to: #form; andShow: [ :a | a magritte description: [:number | number description]; onAnswer: [ :value | collection add: value. browser update ]]. browser openOn: 42
Cheers, Doru
On 15 Sep 2011, at 16:32, Esteban Lorenzano wrote:
for instance, this:
browser transmit to: #detail; from: #list; andShow: [ :presenter | presenter morph title: [ :anItem | anItem asString ]; act: [ :presentation :anItem | self removeItem: anItem ] icon: LWUIIcons / #delete entitled: 'Borrar'; display: [ :anItem | (self magritteDescription asMorphOn: anItem) addButtons: #(save); onAnswer: [ :value | self updateItem: value ]; morph ] ].
...does exactly what I need... so... I don't need to use the magritte presentation at all... I know. But... it shouldn't have an option to do this? otherwise, I think is not useful at all, for certain scenaries (and we should stuck with morph presentation) :(
El 15/09/2011, a las 11:12a.m., Johan Fabry escribió:
One trick that I do in AspectMaps to notify updates (going around glamour limitations) is to use announcements. For example I send an event whenever the underlying model has changed:
self announcer announce: (AMModelChanged new).
I force a refresh of the pane when this happens using the code below. You could do the same: send an event when the #save call is made ...
browser transmit to: #mpanel; from: ... ; andShow: [:a | a mondrian painting: [ ...]; updateOn: AMModelChanged from: [:ent | self announcer ]].
On 15 Sep 2011, at 09:54, Esteban Lorenzano wrote:
Hi, I'm making some progress here... but now I need another feature. As I'm using glamour and magritte to present some data who is persistent, I need to being able to react to a #save call on a magritte presentation. For instance... in my browser:
... browser transmit to: #detail; from: #list; andShow: [ :presenter | presenter magritte title: [ :anItem | anItem asString ]; act: [ :presentation :anItem | self removeItem: anItem ] icon: LWUIIcons / #userTrash entitled: 'Borrar' ]. ...
how can I know if user pressed #save and there is a modified object there? (to update persistent repository) working with plain magritte, I'd do:
... anObject asMorph onAnswer: [ :value | blah, blah ]; morph. ...
...so... is there a way in glamour to react to updated objects?
cheers, Esteban _______________________________________________ Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
---> Save our in-boxes! http://emailcharter.org <---
Johan Fabry jfabry@dcc.uchile.cl - http://dcc.uchile.cl/~jfabry PLEIAD Lab - Computer Science Department (DCC) - University of Chile
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- www.tudorgirba.com
"When people care, great things can happen."