Hi,
I tried to make a script for Mondrian and I made a writing error. I put a bloc on borderColor: without the bloc parameter. The reaction of Mondrian is strange: Rectangle becomes red..... When I remove the bloc or I put the bloc parameter (as: [:e | Color gray]), it works fine. Here is the small script to test: ============= |view o o2| view := MOViewRenderer new. o := OrderedCollection new: 1000. o2 := #(1 2 3 4 5 6 7 8 9 10). 1 to: 100 do:[:i | o add: i]. (view shape: (MORectangleShape new width: 200; height: 200; withBorder; borderColor: [Color gray])). view nodes: o. view layout: (MOGridLayout new gapSize: 1). view open ============= Cheers --- Jannik Laval _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Hi,
This is really strange. I do not understand why it does not crash :). Doru On 16 Jun 2010, at 09:58, Laval Jannik wrote: > Hi, > > I tried to make a script for Mondrian and I made a writing error. > I put a bloc on borderColor: without the bloc parameter. > > The reaction of Mondrian is strange: Rectangle becomes red..... > When I remove the bloc or I put the bloc parameter (as: [:e | Color > gray]), it works fine. > > Here is the small script to test: > ============= > |view o o2| > view := MOViewRenderer new. > o := OrderedCollection new: 1000. > o2 := #(1 2 3 4 5 6 7 8 9 10). > 1 to: 100 do:[:i | o add: i]. > (view shape: (MORectangleShape new > width: 200; > height: 200; > withBorder; > borderColor: [Color gray])). > view nodes: o. > view layout: (MOGridLayout new gapSize: 1). > view open > ============= > > Cheers > --- > Jannik Laval > > _______________________________________________ > 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 |
In reply to this post by jannik laval
Some times ago, I inserted an exception handler somewhere that catch the exception the code user may throw. This is not the best way to deal with exception, but Pharo does not make things easy. If you have a wrong behavior in your [:each | ... ] block that you provide to width: or height:, you can freeze your image. The problem comes from Morphic I guess. Displaying the widget as red indicates that there is an error.
If you have a better implementation for handling exception, I will delighted to discuss about. But I fear that there is no easy solution for now. Alexandre On 16 Jun 2010, at 03:58, Laval Jannik wrote: > Hi, > > I tried to make a script for Mondrian and I made a writing error. > I put a bloc on borderColor: without the bloc parameter. > > The reaction of Mondrian is strange: Rectangle becomes red..... > When I remove the bloc or I put the bloc parameter (as: [:e | Color gray]), it works fine. > > Here is the small script to test: > ============= > |view o o2| > view := MOViewRenderer new. > o := OrderedCollection new: 1000. > o2 := #(1 2 3 4 5 6 7 8 9 10). > 1 to: 100 do:[:i | o add: i]. > (view shape: (MORectangleShape new > width: 200; > height: 200; > withBorder; > borderColor: [Color gray])). > view nodes: o. > view layout: (MOGridLayout new gapSize: 1). > view open > ============= > > Cheers > --- > Jannik Laval > > _______________________________________________ > 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 |
On Jun 16, 2010, at 15:22 , Alexandre Bergel wrote: > Displaying the widget as red indicates that there is an error. eheh, nice idea. I did not understand why in modifying the borderColor block the color of the shape became red. I do not know how we can improve this, because the problem here is that red is a color used in visualization. Is it "easy" to draw a cross in shape with errors ? --- Jannik Laval _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
>> Displaying the widget as red indicates that there is an error.
> > > eheh, nice idea. > I did not understand why in modifying the borderColor block the color of the shape became red. > > I do not know how we can improve this, because the problem here is that red is a color used in visualization. > Is it "easy" to draw a cross in shape with errors ? Easy, but this means that some extra check will have to be done each time a rectangle is displayed (e.g., if there is an error or not when computing the metrics). These days people have been complaining about speed. I added an entry in google instead. http://code.google.com/p/moose-technology/issues/detail?id=418 Cheers, Alexandre _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Free forum by Nabble | Edit this page |