Hi, I have a browser with some kind of "buffer" where I can hold a value selected from one of several list in the browser. The buffer itself is implemented as a pane containing a list with only one element in it, it is populated when I strongSelect (double click) in one of the source list: (browser transmit) to: #buffer; from: #PackagePane port: #strongSelection; andShow: [:a | a list display: [:anEntity | {anEntity} ] ]. (browser transmit) to: #buffer; from: #ClassPane port: #strongSelection; andShow: [:a | a list display: [:anEntity | {anEntity} ] ]. I also transmit from one list to the other with simple selection (click) (browser transmit) to: #ClassPane; from: #PackagePane; andShow: [:b | | gmlList | gmlList := b list. gmlList display: [:anEntity | anEntity classes]]; It works "thusly" : if I click on a package in the PackagePane, its class appear in the ClassPane. If I double click on a package or a class, then it also appears in the "buffer" However, if I double click on a class, it goes correctly in the buffer, but if after I single click on a package, the "buffer" is wiped. This is not the intended behavior ... Bug or feature? and if it is a feature, how to get the feature I want? nicolas -- Nicolas Anquetil -- RMod research team (Inria) _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Hi,
In this case, it is not a bug. The reason it gets "wiped" is that when you are selecting a new package, you delete all ports from the target #ClassPane, and this in turn triggers the transmission of nil to the #buffer pane. What you need to do is to not transmit from #ClassPane to #buffer when the strongSelection value is nil. Here is a working example: browser := GLMTabulator new. browser column: #parent; column: #child; column: #buffer. (browser transmit) to: #buffer; from: #parent port: #strongSelection; andShow: [:a | a list display: [:x | {x} ] ]. (browser transmit) to: #buffer; from: #child port: #strongSelection; when: #notNil; andShow: [:a | a list display: [:x | {x} ] ]. (browser transmit) to: #child; from: #parent; andShow: [:a | a list display: [:x | 1 to: x]]. browser openOn: #(1 2 3 4) Btw, in the future, please post a full script (including initialization and opening). It saves time to try and to provide the solution. Cheers, Doru On Mar 4, 2013, at 3:12 PM, Nicolas Anquetil <[hidden email]> wrote: > > Hi, > > I have a browser with some kind of "buffer" where I can hold a value selected from one of several list in the browser. > The buffer itself is implemented as a pane containing a list with only one element in it, it is populated when I strongSelect (double click) in one of the source list: > > (browser transmit) to: #buffer; from: #PackagePane port: #strongSelection; andShow: [:a | > a list > display: [:anEntity | {anEntity} ] > ]. > (browser transmit) to: #buffer; from: #ClassPane port: #strongSelection; andShow: [:a | > a list > display: [:anEntity | {anEntity} ] > ]. > > I also transmit from one list to the other with simple selection (click) > > (browser transmit) to: #ClassPane; from: #PackagePane; andShow: [:b | | gmlList | > gmlList := b list. > gmlList > display: [:anEntity | anEntity classes]]; > > It works "thusly" : if I click on a package in the PackagePane, its class appear in the ClassPane. > If I double click on a package or a class, then it also appears in the "buffer" > > However, if I double click on a class, it goes correctly in the buffer, but if after I single click on a package, the "buffer" is wiped. > This is not the intended behavior ... > > Bug or feature? > and if it is a feature, how to get the feature I want? > > nicolas > > -- > Nicolas Anquetil -- RMod research team (Inria) > > _______________________________________________ > Moose-dev mailing list > [hidden email] > https://www.iam.unibe.ch/mailman/listinfo/moose-dev -- www.tudorgirba.com "Presenting is storytelling." _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
BTW, never thanked you for this one. (actually, only today I realized that you answered. Too much running around :-( ) It works. Is there a reproducible process I could have followed to find out by myself? Thanks anyway nicolas On 03/05/2013 10:33 PM, Tudor Girba wrote: > Hi, > > In this case, it is not a bug. The reason it gets "wiped" is that when you are selecting a new package, you delete all ports from the target #ClassPane, and this in turn triggers the transmission of nil to the #buffer pane. > > What you need to do is to not transmit from #ClassPane to #buffer when the strongSelection value is nil. > > Here is a working example: > > browser := GLMTabulator new. > browser column: #parent; column: #child; column: #buffer. > (browser transmit) to: #buffer; from: #parent port: #strongSelection; andShow: [:a | > a list display: [:x | {x} ] ]. > (browser transmit) to: #buffer; from: #child port: #strongSelection; when: #notNil; andShow: [:a | > a list display: [:x | {x} ] ]. > (browser transmit) to: #child; from: #parent; andShow: [:a | > a list display: [:x | 1 to: x]]. > browser openOn: #(1 2 3 4) > > > Btw, in the future, please post a full script (including initialization and opening). It saves time to try and to provide the solution. > > Cheers, > Doru > > > On Mar 4, 2013, at 3:12 PM, Nicolas Anquetil <[hidden email]> wrote: > >> Hi, >> >> I have a browser with some kind of "buffer" where I can hold a value selected from one of several list in the browser. >> The buffer itself is implemented as a pane containing a list with only one element in it, it is populated when I strongSelect (double click) in one of the source list: >> >> (browser transmit) to: #buffer; from: #PackagePane port: #strongSelection; andShow: [:a | >> a list >> display: [:anEntity | {anEntity} ] >> ]. >> (browser transmit) to: #buffer; from: #ClassPane port: #strongSelection; andShow: [:a | >> a list >> display: [:anEntity | {anEntity} ] >> ]. >> >> I also transmit from one list to the other with simple selection (click) >> >> (browser transmit) to: #ClassPane; from: #PackagePane; andShow: [:b | | gmlList | >> gmlList := b list. >> gmlList >> display: [:anEntity | anEntity classes]]; >> >> It works "thusly" : if I click on a package in the PackagePane, its class appear in the ClassPane. >> If I double click on a package or a class, then it also appears in the "buffer" >> >> However, if I double click on a class, it goes correctly in the buffer, but if after I single click on a package, the "buffer" is wiped. >> This is not the intended behavior ... >> >> Bug or feature? >> and if it is a feature, how to get the feature I want? >> >> nicolas >> >> -- >> Nicolas Anquetil -- RMod research team (Inria) >> >> _______________________________________________ >> Moose-dev mailing list >> [hidden email] >> https://www.iam.unibe.ch/mailman/listinfo/moose-dev > -- > www.tudorgirba.com > > "Presenting is storytelling." > > > _______________________________________________ > Moose-dev mailing list > [hidden email] > https://www.iam.unibe.ch/mailman/listinfo/moose-dev -- Nicolas Anquetil -- RMod research team (Inria) _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Hi,
No stress with thanking :). There is a little description of how transmissions work here: http://www.themoosebook.org/book/internals/glamour/transmissions What you could take away from this page is that you can have different strategies for a transmission. The one used by #andShow: is the GLMReplacePresentationsStrategy. If you look in the code, you will see that: transmitIn: aContext ... self transmission destination pane clearIn: aContext. which sets to nil the values of all ports. And any change, including changing to nil, will trigger a transmission. The way around it is to guard the transmission with a condition. Cheers, Doru On Mar 15, 2013, at 7:31 PM, Nicolas Anquetil <[hidden email]> wrote: > > BTW, never thanked you for this one. > > (actually, only today I realized that you answered. Too much running around :-( ) > > It works. > > Is there a reproducible process I could have followed to find out by myself? > > Thanks anyway > > nicolas > > On 03/05/2013 10:33 PM, Tudor Girba wrote: >> Hi, >> >> In this case, it is not a bug. The reason it gets "wiped" is that when you are selecting a new package, you delete all ports from the target #ClassPane, and this in turn triggers the transmission of nil to the #buffer pane. >> >> What you need to do is to not transmit from #ClassPane to #buffer when the strongSelection value is nil. >> >> Here is a working example: >> >> browser := GLMTabulator new. >> browser column: #parent; column: #child; column: #buffer. >> (browser transmit) to: #buffer; from: #parent port: #strongSelection; andShow: [:a | >> a list display: [:x | {x} ] ]. >> (browser transmit) to: #buffer; from: #child port: #strongSelection; when: #notNil; andShow: [:a | >> a list display: [:x | {x} ] ]. >> (browser transmit) to: #child; from: #parent; andShow: [:a | >> a list display: [:x | 1 to: x]]. >> browser openOn: #(1 2 3 4) >> >> >> Btw, in the future, please post a full script (including initialization and opening). It saves time to try and to provide the solution. >> >> Cheers, >> Doru >> >> >> On Mar 4, 2013, at 3:12 PM, Nicolas Anquetil <[hidden email]> wrote: >> >>> Hi, >>> >>> I have a browser with some kind of "buffer" where I can hold a value selected from one of several list in the browser. >>> The buffer itself is implemented as a pane containing a list with only one element in it, it is populated when I strongSelect (double click) in one of the source list: >>> >>> (browser transmit) to: #buffer; from: #PackagePane port: #strongSelection; andShow: [:a | >>> a list >>> display: [:anEntity | {anEntity} ] >>> ]. >>> (browser transmit) to: #buffer; from: #ClassPane port: #strongSelection; andShow: [:a | >>> a list >>> display: [:anEntity | {anEntity} ] >>> ]. >>> >>> I also transmit from one list to the other with simple selection (click) >>> >>> (browser transmit) to: #ClassPane; from: #PackagePane; andShow: [:b | | gmlList | >>> gmlList := b list. >>> gmlList >>> display: [:anEntity | anEntity classes]]; >>> >>> It works "thusly" : if I click on a package in the PackagePane, its class appear in the ClassPane. >>> If I double click on a package or a class, then it also appears in the "buffer" >>> >>> However, if I double click on a class, it goes correctly in the buffer, but if after I single click on a package, the "buffer" is wiped. >>> This is not the intended behavior ... >>> >>> Bug or feature? >>> and if it is a feature, how to get the feature I want? >>> >>> nicolas >>> >>> -- >>> Nicolas Anquetil -- RMod research team (Inria) >>> >>> _______________________________________________ >>> Moose-dev mailing list >>> [hidden email] >>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev >> -- >> www.tudorgirba.com >> >> "Presenting is storytelling." >> >> >> _______________________________________________ >> Moose-dev mailing list >> [hidden email] >> https://www.iam.unibe.ch/mailman/listinfo/moose-dev > > -- > Nicolas Anquetil -- RMod research team (Inria) > > _______________________________________________ > Moose-dev mailing list > [hidden email] > https://www.iam.unibe.ch/mailman/listinfo/moose-dev -- www.tudorgirba.com "Problem solving efficiency grows with the abstractness level of problem understanding." _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Free forum by Nabble | Edit this page |