Highlights: - BlCornerRadii - 1st class corners - yay to the death of cryptic arrays for this kind of thing :) Questions: - How would one do e.g. a ticking clock in Bloc? The only possibly relevant example I see is BlAnimatedCursor. Is that a typical usage? One thing that I'm not sure how to translate to a BlElement is that the cursor seems to be responsible for starting and stopping the animation via #activateOn:, which doesn't exist for an element. How would one prevent an element's animation from continuing to run after a space was closed? - BlElement has 278 instance-side methods. A frequent battle cry against Morphic was the bloated Morph class with 899. Definitely an improvement, but are we "there yet"? - Does Bloc implement its own keybinding outside of "Keymapping" e.g. BlShortcut? If so, why? Will it ultimately be a replacement? - In BlTextEditElement class>>#exampleText, text construction seems awfully complex (`text := BrRopedText rope: (BrCollectionRope collection: (String loremIpsum: 30)). text attributes: { BrFontWeightAttribute bold }.`. How does that way contrast to e.g. `'X' asRopedText`? Problems: BlBasicExamples - #exampleShapes, select the yellow shape with red border -> inspector -> Transformations Tab -> Click on Composition -> "ShouldNotImplement: #multiplyOn: should not have been implemented in BlCompositeTransformation" - #exampleImageBackground -> "ShouldBeImplemented: #fillPath:withForm: should have been implemented in SpartaCairoFillPainter" BlTextEditElement class>>#exampleText - insert some characters and then press [delete] -> "Error: Illegal sub-sequence end index: 44" - There is aBlSelectionHandler, but I can't seem to select any of the text BrAttributeRopeExamples#>>simpleRope -> inspect return value -> In inspector, click on "Children" tab -> "Error: Improper store into indexable object" - In BlLinearLayoutExamples class>>#exampleVerticalLeftCenterRightRTL, - the red sub-element does `c linear horizontal alignLeft`, which is then overridden by its parent's `BlLinearLayout vertical "rightToLeft"`. Was it intentional to show the precedence because I found it confusing when an element that sent #alignLeft showed up on the right! - the yellow sub-element does not appear at all. Maybe it should do a `c vertical exact: 100.` like its siblings? - All BlAnimationExamples lead to deprecation warnings and DNU's, but *do not even attempt* #exampleBallsAnim or face endlessly multplying debugger windows! ----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
Hi Sean, Thanks for the feedback :) I will take a look and come up with an answer in a few days. If you have time to play more or if you found other issues, please feel free to list them here or open bug reports on Github ( https://github.com/pharo-graphics/Bloc/issues) Cheers, Alex On 23 October 2017 at 04:15, Sean P. DeNigris <sean@clipperadams.com> wrote:
Highlights:
- BlCornerRadii - 1st class corners - yay to the death of cryptic arrays for this kind of thing :)
Questions:
- How would one do e.g. a ticking clock in Bloc? The only possibly relevant example I see is BlAnimatedCursor. Is that a typical usage? One thing that I'm not sure how to translate to a BlElement is that the cursor seems to be responsible for starting and stopping the animation via #activateOn:, which doesn't exist for an element. How would one prevent an element's animation from continuing to run after a space was closed? - BlElement has 278 instance-side methods. A frequent battle cry against Morphic was the bloated Morph class with 899. Definitely an improvement, but are we "there yet"? - Does Bloc implement its own keybinding outside of "Keymapping" e.g. BlShortcut? If so, why? Will it ultimately be a replacement? - In BlTextEditElement class>>#exampleText, text construction seems awfully complex (`text := BrRopedText rope: (BrCollectionRope collection: (String loremIpsum: 30)). text attributes: { BrFontWeightAttribute bold }.`. How does that way contrast to e.g. `'X' asRopedText`?
Problems:
BlBasicExamples - #exampleShapes, select the yellow shape with red border -> inspector -> Transformations Tab -> Click on Composition -> "ShouldNotImplement: #multiplyOn: should not have been implemented in BlCompositeTransformation" - #exampleImageBackground -> "ShouldBeImplemented: #fillPath:withForm: should have been implemented in SpartaCairoFillPainter" BlTextEditElement class>>#exampleText - insert some characters and then press [delete] -> "Error: Illegal sub-sequence end index: 44" - There is aBlSelectionHandler, but I can't seem to select any of the text BrAttributeRopeExamples#>>simpleRope -> inspect return value -> In inspector, click on "Children" tab -> "Error: Improper store into indexable object" - In BlLinearLayoutExamples class>>#exampleVerticalLeftCenterRightRTL, - the red sub-element does `c linear horizontal alignLeft`, which is then overridden by its parent's `BlLinearLayout vertical "rightToLeft"`. Was it intentional to show the precedence because I found it confusing when an element that sent #alignLeft showed up on the right! - the yellow sub-element does not appear at all. Maybe it should do a `c vertical exact: 100.` like its siblings? - All BlAnimationExamples lead to deprecation warnings and DNU's, but *do not even attempt* #exampleBallsAnim or face endlessly multplying debugger windows!
----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
Thanks for the feedback! Alex will reply in more details on Wednesday. In the meantime, some comments inline.
On Oct 23, 2017, at 4:15 AM, Sean P. DeNigris <sean@clipperadams.com> wrote:
Highlights:
- BlCornerRadii - 1st class corners - yay to the death of cryptic arrays for this kind of thing :)
Questions:
- How would one do e.g. a ticking clock in Bloc? The only possibly relevant example I see is BlAnimatedCursor. Is that a typical usage? One thing that I'm not sure how to translate to a BlElement is that the cursor seems to be responsible for starting and stopping the animation via #activateOn:, which doesn't exist for an element. How would one prevent an element's animation from continuing to run after a space was closed? - BlElement has 278 instance-side methods. A frequent battle cry against Morphic was the bloated Morph class with 899. Definitely an improvement, but are we "there yetâ?
What do you mean?
- Does Bloc implement its own keybinding outside of "Keymapping" e.g. BlShortcut? If so, why? Will it ultimately be a replacement?
We wanted the simplest mechanism that we could find to start with. To this end, BlShortcut is simpler than Keymapping in that it does not include global shortcuts, and categories. In Bloc, we only have shortcut bubbling from the leaf element to the root, and all shortcuts are instance-based.
- In BlTextEditElement class>>#exampleText, text construction seems awfully complex (`text := BrRopedText rope: (BrCollectionRope collection: (String loremIpsum: 30)). text attributes: { BrFontWeightAttribute bold }.`. How does that way contrast to e.g. `'X' asRopedText`?
Both are valid. The example means to show the most detailed way to construct the text object.
Problems:
BlBasicExamples - #exampleShapes, select the yellow shape with red border -> inspector -> Transformations Tab -> Click on Composition -> "ShouldNotImplement: #multiplyOn: should not have been implemented in BlCompositeTransformation" - #exampleImageBackground -> "ShouldBeImplemented: #fillPath:withForm: should have been implemented in SpartaCairoFillPainter" BlTextEditElement class>>#exampleText - insert some characters and then press [delete] -> "Error: Illegal sub-sequence end index: 44" - There is aBlSelectionHandler, but I can't seem to select any of the text BrAttributeRopeExamples#>>simpleRope -> inspect return value -> In inspector, click on "Children" tab -> "Error: Improper store into indexable object" - In BlLinearLayoutExamples class>>#exampleVerticalLeftCenterRightRTL, - the red sub-element does `c linear horizontal alignLeft`, which is then overridden by its parent's `BlLinearLayout vertical "rightToLeft"`. Was it intentional to show the precedence because I found it confusing when an element that sent #alignLeft showed up on the right! - the yellow sub-element does not appear at all. Maybe it should do a `c vertical exact: 100.` like its siblings? - All BlAnimationExamples lead to deprecation warnings and DNU's, but *do not even attempt* #exampleBallsAnim or face endlessly multplying debugger windows!
I will let Alex answer to these ones :) Doru
----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
-- www.tudorgirba.com www.feenk.com "Some battles are better lost than fought."
BlElement has 278 instance-side methods. A frequent battle cry against Morphic was the bloated Morph class with 899. Definitely an improvement, but are we "there yetâ?
Quick method count metric: (BlElement methods reject: [ :aMethod | aMethod isDeprecated or: [ aMethod isExtension ] ]) size gives us *"224"* instance side methods. Or putting this into perspective: classes := Smalltalk allClasses collect: [ :aClass | aClass -> (aClass methods reject: [ :aMethod | aMethod isDeprecated or: [ aMethod isExtension ] ]) size ]. classes := (classes sorted: [ :a :b | a value > b value ]) collect: #yourself as: OrderPreservingDictionary. classes [image: Inline images 1] Cheers, Alex On 23 October 2017 at 09:49, Tudor Girba <tudor@tudorgirba.com> wrote:
Thanks for the feedback!
Alex will reply in more details on Wednesday.
In the meantime, some comments inline.
On Oct 23, 2017, at 4:15 AM, Sean P. DeNigris <sean@clipperadams.com> wrote:
Highlights:
- BlCornerRadii - 1st class corners - yay to the death of cryptic arrays for this kind of thing :)
Questions:
- How would one do e.g. a ticking clock in Bloc? The only possibly relevant example I see is BlAnimatedCursor. Is that a typical usage? One thing that I'm not sure how to translate to a BlElement is that the cursor seems to be responsible for starting and stopping the animation via #activateOn:, which doesn't exist for an element. How would one prevent an element's animation from continuing to run after a space was closed? - BlElement has 278 instance-side methods. A frequent battle cry against Morphic was the bloated Morph class with 899. Definitely an improvement, but are we "there yetâ?
What do you mean?
- Does Bloc implement its own keybinding outside of "Keymapping" e.g. BlShortcut? If so, why? Will it ultimately be a replacement?
We wanted the simplest mechanism that we could find to start with. To this end, BlShortcut is simpler than Keymapping in that it does not include global shortcuts, and categories. In Bloc, we only have shortcut bubbling from the leaf element to the root, and all shortcuts are instance-based.
- In BlTextEditElement class>>#exampleText, text construction seems awfully complex (`text := BrRopedText rope: (BrCollectionRope collection: (String loremIpsum: 30)). text attributes: { BrFontWeightAttribute bold }.`. How does that way contrast to e.g. `'X' asRopedText`?
Both are valid. The example means to show the most detailed way to construct the text object.
Problems:
BlBasicExamples - #exampleShapes, select the yellow shape with red border -> inspector -> Transformations Tab -> Click on Composition -> "ShouldNotImplement: #multiplyOn: should not have been implemented in BlCompositeTransformation" - #exampleImageBackground -> "ShouldBeImplemented: #fillPath:withForm: should have been implemented in SpartaCairoFillPainter" BlTextEditElement class>>#exampleText - insert some characters and then press [delete] -> "Error: Illegal sub-sequence end index: 44" - There is aBlSelectionHandler, but I can't seem to select any of the text BrAttributeRopeExamples#>>simpleRope -> inspect return value -> In inspector, click on "Children" tab -> "Error: Improper store into indexable object" - In BlLinearLayoutExamples class>>#exampleVerticalLeftCenterRightRTL, - the red sub-element does `c linear horizontal alignLeft`, which is then overridden by its parent's `BlLinearLayout vertical "rightToLeft"`. Was it intentional to show the precedence because I found it confusing when an element that sent #alignLeft showed up on the right! - the yellow sub-element does not appear at all. Maybe it should do a `c vertical exact: 100.` like its siblings? - All BlAnimationExamples lead to deprecation warnings and DNU's, but *do not even attempt* #exampleBallsAnim or face endlessly multplying debugger windows!
I will let Alex answer to these ones :)
Doru
----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.
html
-- www.tudorgirba.com www.feenk.com
"Some battles are better lost than fought."
Tudor Girba-2 wrote
Thanks for the feedback!
But of course! Thanks for pushing Bloc :) IMHO a clean low-level graphics framework is the linchpin to unleash a tremendous amount of creativity in the Pharo community. I have several dream projects that I placed on long-term hold after getting stuck in Morphic quicksand :/ Tudor Girba-2 wrote
- How would one do e.g. a ticking clock in Bloc? The only possibly relevant example I see is BlAnimatedCursor. Is that a typical usage? One thing that I'm not sure how to translate to a BlElement is that the cursor seems to be responsible for starting and stopping the animation via #activateOn:, which doesn't exist for an element. How would one prevent an element's animation from continuing to run after a space was closed? What do you mean?
I guess I mean what is the Bloc version of #step that would enable us to do e.g. Squeak's mouse-eyes-tracking-the-cursor or Lively Kernel's clock: <http://forum.world.st/file/t128965/Chromium5.png> Tudor Girba-2 wrote
- BlElement has 278 instance-side methods. A frequent battle cry against Morphic was the bloated Morph class with 899. Definitely an improvement, but are we "there yetâ? What do you mean?
Is there a consensus on a maximum number of instance-side methods before a class becomes impossible to understand, and if so where does BlElement fall on that scale? ----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
2017-10-24 2:04 GMT+02:00 Sean P. DeNigris <sean@clipperadams.com>:
Tudor Girba-2 wrote
Thanks for the feedback!
But of course! Thanks for pushing Bloc :) IMHO a clean low-level graphics framework is the linchpin to unleash a tremendous amount of creativity in the Pharo community. I have several dream projects that I placed on long-term hold after getting stuck in Morphic quicksand :/
Tudor Girba-2 wrote
- How would one do e.g. a ticking clock in Bloc? The only possibly relevant example I see is BlAnimatedCursor. Is that a typical usage? One thing that I'm not sure how to translate to a BlElement is that the cursor seems to be responsible for starting and stopping the animation via #activateOn:, which doesn't exist for an element. How would one prevent an element's animation from continuing to run after a space was closed? What do you mean?
I guess I mean what is the Bloc version of #step that would enable us to do e.g. Squeak's mouse-eyes-tracking-the-cursor or Lively Kernel's clock: <http://forum.world.st/file/t128965/Chromium5.png>
Tudor Girba-2 wrote
- BlElement has 278 instance-side methods. A frequent battle cry against Morphic was the bloated Morph class with 899. Definitely an improvement, but are we "there yetâ? What do you mean?
Is there a consensus on a maximum number of instance-side methods before a class becomes impossible to understand, and if so where does BlElement fall on that scale?
I dont think this number alone is a problem. As long as the "responsibility" of this class is well structured. A problem with the Morph class is, that it acts as many things at once. A structured container, a model, a view, a graphical object, a widget base ... About BlElement, I am more afraid about the number of instance variables
----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
Hi, Indeed, instance variables is what we are mainly concerned with as well. We keep on trimming, but it still feels like too many variables. Cheers, Doru
On Oct 24, 2017, at 8:59 AM, Nicolai Hess <nicolaihess@gmail.com> wrote:
2017-10-24 2:04 GMT+02:00 Sean P. DeNigris <sean@clipperadams.com>: Tudor Girba-2 wrote
Thanks for the feedback!
But of course! Thanks for pushing Bloc :) IMHO a clean low-level graphics framework is the linchpin to unleash a tremendous amount of creativity in the Pharo community. I have several dream projects that I placed on long-term hold after getting stuck in Morphic quicksand :/
Tudor Girba-2 wrote
- How would one do e.g. a ticking clock in Bloc? The only possibly relevant example I see is BlAnimatedCursor. Is that a typical usage? One thing that I'm not sure how to translate to a BlElement is that the cursor seems to be responsible for starting and stopping the animation via #activateOn:, which doesn't exist for an element. How would one prevent an element's animation from continuing to run after a space was closed? What do you mean?
I guess I mean what is the Bloc version of #step that would enable us to do e.g. Squeak's mouse-eyes-tracking-the-cursor or Lively Kernel's clock: <http://forum.world.st/file/t128965/Chromium5.png>
Tudor Girba-2 wrote
- BlElement has 278 instance-side methods. A frequent battle cry against Morphic was the bloated Morph class with 899. Definitely an improvement, but are we "there yetâ? What do you mean?
Is there a consensus on a maximum number of instance-side methods before a class becomes impossible to understand, and if so where does BlElement fall on that scale?
I dont think this number alone is a problem. As long as the "responsibility" of this class is well structured. A problem with the Morph class is, that it acts as many things at once. A structured container, a model, a view, a graphical object, a widget base ...
About BlElement, I am more afraid about the number of instance variables
----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
-- www.tudorgirba.com www.feenk.com "Sometimes the best solution is not the best solution."
Hi Sean, lBasicExamples
- #exampleShapes, select the yellow shape with red border -> inspector -> Transformations Tab -> Click on Composition -> "ShouldNotImplement: #multiplyOn: should not have been implemented in BlCompositeTransformation"
I don't understand how you guys find these kind of bugs :D Fixed, thanks! - In BlLinearLayoutExamples class>>#exampleVerticalLeftCenterRightRTL - the yellow sub-element does not appear at all. Maybe it should do a `c
vertical exact: 100.` like its siblings?
This is a bug of the default extent of the element and its geometry. Element had default extent of 50@50 while geometry 1@1. Recently we added a smarter change recording mechanism that collects all extent/position changes within a frame and then merges them together in order to produce a single notification event. Since in that example we request element's size to be (50@50) there will be effectively no change in extent, so no event is produced and geometry does not adapt itself to match element's size => geometry's extent stays 1@1 and only a tiny yellow dot is rendered :) Wrote a test and changed default element size to be (0@0). - All BlAnimationExamples lead to deprecation warnings and DNU's, but *do not
even attempt* #exampleBallsAnim or face endlessly multplying debugger windows!
Indeed :) A short answer is that it is expected, taking into account a class comment :D [image: Inline images 1] A bit longer answer would require to read the following document https://drafts.csswg.org/css-transforms/#interpolation-of-transforms <https://drafts.csswg.org/css-transforms/#interpolation-of-transforms> to get an idea of what is going on. The point is that animating transformations like translation, scale or rotation is very non trivial. It requires us to decompose a resulting transformation matrix, interpolate decomposed values at animation time "t" and finally recompose it back as matrix :) The only missing piece left is interpolation of matrix decomposition, so we are not far away from having animation examples work again. Below is a screenshot of a composite transformation consisting of translations separated by scale and applied rotation on top of all. Note that resulting translation is not (20, 20) as one would think, instead it depends on scale and rotation which causes the initial problem. Also, one can see that "scaling" matrix components on the main matrix diagonal are not equal to (2, 2) because of rotation... However, once done we will have a powerful transformation library! [image: Inline images 1] BlTextEditElement class>>#exampleText
- insert some characters and then press [delete] -> "Error: Illegal sub-sequence end index: 44" - There is aBlSelectionHandler, but I can't seem to select any of the text
Aha, I forgot about it, thanks! At this point BlTextEditElement is only used internally by Moldable Editor so I will probably move it away from Bloc. Thanks for the feedback :) Cheers, Alex On 24 October 2017 at 11:01, Tudor Girba <tudor@tudorgirba.com> wrote:
Hi,
Indeed, instance variables is what we are mainly concerned with as well. We keep on trimming, but it still feels like too many variables.
Cheers, Doru
On Oct 24, 2017, at 8:59 AM, Nicolai Hess <nicolaihess@gmail.com> wrote:
2017-10-24 2:04 GMT+02:00 Sean P. DeNigris <sean@clipperadams.com>: Tudor Girba-2 wrote
Thanks for the feedback!
But of course! Thanks for pushing Bloc :) IMHO a clean low-level graphics framework is the linchpin to unleash a tremendous amount of creativity in the Pharo community. I have several dream projects that I placed on long-term hold after getting stuck in Morphic quicksand :/
Tudor Girba-2 wrote
- How would one do e.g. a ticking clock in Bloc? The only possibly relevant example I see is BlAnimatedCursor. Is that a typical usage? One thing that I'm not sure how to translate to a BlElement is that the cursor seems to be responsible for starting and stopping the animation via #activateOn:, which doesn't exist for an element. How would one prevent an element's animation from continuing to run after a space was closed? What do you mean?
I guess I mean what is the Bloc version of #step that would enable us to do e.g. Squeak's mouse-eyes-tracking-the-cursor or Lively Kernel's clock: <http://forum.world.st/file/t128965/Chromium5.png>
Tudor Girba-2 wrote
- BlElement has 278 instance-side methods. A frequent battle cry against Morphic was the bloated Morph class with 899. Definitely an improvement, but are we "there yetâ? What do you mean?
Is there a consensus on a maximum number of instance-side methods before a class becomes impossible to understand, and if so where does BlElement fall on that scale?
I dont think this number alone is a problem. As long as the "responsibility" of this class is well structured. A problem with the Morph class is, that it acts as many things at once. A structured container, a model, a view, a graphical object, a widget base ...
About BlElement, I am more afraid about the number of instance variables
----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.ht ml
-- www.tudorgirba.com www.feenk.com
"Sometimes the best solution is not the best solution."
Aliaksei Syrel wrote
I don't understand how you guys find these kind of bugs :D
We have a talent for destruction ;) Aliaksei Syrel wrote
Aha, I forgot about it, thanks! At this point BlTextEditElement is only used internally by Moldable Editor so I will probably move it away from Bloc.
Ah, okay. IHMO at least a basic editable text morph (and ideally a real editor morph as well) is essential to people starting to play/experiment/test Bloc for real. Aliaksei Syrel wrote
Thanks for the feedback :)
Sure! Any thoughts on this:
How would one do e.g. a ticking clock in Bloc? The only possibly relevant example I see is BlAnimatedCursor. Is that a typical usage? One thing that I'm not sure how to translate to a BlElement is that the cursor seems to be responsible for starting and stopping the animation via #activateOn:, which doesn't exist for an element. How would one prevent an element's animation from continuing to run after a space was closed?⦠I guess I mean what is the Bloc version of #step that would enable us to do e.g. Squeak's mouse-eyes-tracking-the-cursor or Lively Kernel's clock: <http://forum.world.st/file/t128965/Chromium5.png>
----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
Hi Sean,
On Oct 25, 2017, at 2:14 PM, Sean P. DeNigris <sean@clipperadams.com> wrote:
Aliaksei Syrel wrote
I don't understand how you guys find these kind of bugs :D
We have a talent for destruction ;)
Aliaksei Syrel wrote
Aha, I forgot about it, thanks! At this point BlTextEditElement is only used internally by Moldable Editor so I will probably move it away from Bloc.
Ah, okay. IHMO at least a basic editable text morph (and ideally a real editor morph as well) is essential to people starting to play/experiment/test Bloc for real.
I think there is a misunderstanding. We distinguish between Bloc and Brick: - Bloc offers the basic management of graphical elements (including layouts, measurements, transformation etc) - Brick offers widgets In Bloc, there exists a basic text widget, but the full fledged moldable editor is part of Brick. While it is important to have Bloc as a generic infrastructure, coming from Morphic you just can look at Bloc and Brick as being one. Doru
Aliaksei Syrel wrote
Thanks for the feedback :)
Sure! Any thoughts on this:
How would one do e.g. a ticking clock in Bloc? The only possibly relevant example I see is BlAnimatedCursor. Is that a typical usage? One thing that I'm not sure how to translate to a BlElement is that the cursor seems to be responsible for starting and stopping the animation via #activateOn:, which doesn't exist for an element. How would one prevent an element's animation from continuing to run after a space was closed?⦠I guess I mean what is the Bloc version of #step that would enable us to do e.g. Squeak's mouse-eyes-tracking-the-cursor or Lively Kernel's clock: <http://forum.world.st/file/t128965/Chromium5.png>
----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
-- www.tudorgirba.com www.feenk.com "Being happy is a matter of choice."
Bump :) Sean P. DeNigris wrote
How would one do e.g. a ticking clock in Bloc? The only possibly relevant example I see is BlAnimatedCursor. Is that a typical usage? One thing that I'm not sure how to translate to a BlElement is that the cursor seems to be responsible for starting and stopping the animation via #activateOn:, which doesn't exist for an element. How would one prevent an element's animation from continuing to run after a space was closed?⦠I guess I mean what is the Bloc version of #step that would enable us to do e.g. Squeak's mouse-eyes-tracking-the-cursor or Lively Kernel's clock: https://upload.wikimedia.org/wikipedia/commons/5/5e/Chromium5.0.375.99_showi...
----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
Hi Sean,
How would one do e.g. a ticking clock in Bloc?
I pushed a clock example to the #master branch (BlClockExample clock) Stepping mechanism can be implemented using infinite animation (stepping is nothing else than a special case of animation). Below is a definition of animation used to rotate second hand by 6 degrees every second. BlNumberTransition new onStepDo: [ :aSecond | secondHand transformDo: [ :aTransform | aTransform rotateBy: aSecond * self minuteRotationDelta - 90 ] ]; from: 0; to: 60; *by: 1;* duration: 1 minute The code above says that we should do a number transition from 0 to 60 by 1 (0,1,2,3,4,5,6,7...60) during 1 minute. On every step we rotate our second hand by appropriate angle in degrees. -90 is needed because clock hands start from Pi/2 radians on a unit circle. In the end we get the following animation: [image: Inline images 1] P.S. In attachment I also send a high quality video. Cheers, Alex On 25 November 2017 at 23:58, Sean P. DeNigris <sean@clipperadams.com> wrote:
Bump :)
Sean P. DeNigris wrote
How would one do e.g. a ticking clock in Bloc? The only possibly relevant example I see is BlAnimatedCursor. Is that a typical usage? One thing that I'm not sure how to translate to a BlElement is that the cursor seems to be responsible for starting and stopping the animation via #activateOn:, which doesn't exist for an element. How would one prevent an element's animation from continuing to run after a space was closed?⦠I guess I mean what is the Bloc version of #step that would enable us to do e.g. Squeak's mouse-eyes-tracking-the-cursor or Lively Kernel's clock: https://upload.wikimedia.org/wikipedia/commons/5/5e/Chromium 5.0.375.99_showing_lively_kernel_using_gtk%2B_theme.png
----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
Aliaksei Syrel wrote
Stepping mechanism can be implemented using infinite animation (stepping is nothing else than a special case of animation).
Okay, cool. So one would change the `loop: 1` in your example to `beInfinite`? Why didn't you do that in the example? Also, what is the lifetime of an infinite animation? ----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
So one would change the `loop: 1` in your example to `beInfinite`? Why didn't you do that in the example?
Because I wanted it to work just one minute :) I don't know, there is no explanation for that. Also, what is the lifetime of an infinite animation? It can only be stopped by sending #stop to it. It is infinite after all. Please note, that animation target is not necessary a visual element, so we can not stop animation when element is removed from the scene graph. It also means that animations are not bound to any specific space, that is why we must not stop animation when space is closed. Infinite animations are not used yet, so we can still find some smart heuristics for stopping. Do you have any particular use-case for animations? Cheers, Alex On 26 November 2017 at 05:23, Sean P. DeNigris <sean@clipperadams.com> wrote:
Aliaksei Syrel wrote
Stepping mechanism can be implemented using infinite animation (stepping is nothing else than a special case of animation).
Okay, cool. So one would change the `loop: 1` in your example to `beInfinite`? Why didn't you do that in the example? Also, what is the lifetime of an infinite animation?
----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
Here is how I see the behaviour of an infinite animation: - stop it when element is removed from the space - resume it when element is re-added to the space It means that some object should store that animation (an element?). What if element is not going to be re-added to the space? Should animation reference it target in a weak manner and remove itself when target is garbage collected? However, we also have target-less animations... There are too many possibilities, that is why I think it should be up to the user of infinite animation how to manage its lifecycle. We could create a factory of pre-configured infinite animations for most common lifecycles. Cheers, Alex
Aliaksei Syrel wrote > Do you have any particular use-case for animations? Just starting to port Morphs to Bloc, so looking for a natural replacement for #step, but maybe I'm missing a paradigm shift? Also, playing with the examples, more feedback: >From the Bloc Example browser: - running an example via the context menu shortcut resets the list selection and scrolling starts from the first item - running an example via the context menu via the mouse resets the list scroll to the beginning - colorsDataSource does not seem to return a graphical item; same with classesDataSource - BlBasicExamples>>imageBackground -> "Instance of MozPath did not understand #bounds" - example_10800El10x10_inWin1200x900_mouseMove50ms -> "Instance of Duration did not understand #adaptToNumber:andSend:" - example_21846nestedEl_in800x800_mouseMove50ms -> "BlElement>>#position: called from BlBenchmark class>>#createSquareAnd4SubSquaresLength:min: has been deprecated" - example_4800El_in800x600 -> "BlElement>>#position: ⦠has been deprecated" - example_5462nestedEl_in800x800_mouseMove50ms -> "BlElement>>#position: ⦠has been deprecated" - example_821nestedEl_in1000x1000_mouseMove50ms -> "BlElement>>#position: ⦠has been deprecated" - `#bezierControlPoints` -> "#emit was sent to nil" - BlDragExamples, BlElementExampleCubeOpenGL, BlEventExamples -> not immediately obvious how to use. Many examples seem to do nothing when clicked from the browser - BlSelectionExamples don't seem to support... selection ha ha - BrAttributeRopeExamples>>#attributesLeft tagged <gtExample>, but an example of what?1 ----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
You should do a fresh Bloc install, because it looks like you only updated Bloc from iceberg. Bloc depends on other projects such as Sparta or Beacon. About examples: gtExamples are not necessarily return instance of BlElement, it is a general all-purpose framework developed independently from Bloc. There are so many complains about absence of class comments, but no one reads them. Looks like it is easier to remove experimental examples completely :) [image: Inline images 1] BlSelectionExamples don't seem to support... selection ha ha Sorry, I don't understand
[image: Inline images 1] Cheers, Alex On 26 November 2017 at 05:59, Aliaksei Syrel <alex.syrel@gmail.com> wrote:
You should do a fresh Bloc install, because it looks like you only updated Bloc from iceberg. Bloc depends on other projects such as Sparta or Beacon. About examples: gtExamples are not necessarily return instance of BlElement, it is a general all-purpose framework developed independently from Bloc.
There are so many complains about absence of class comments, but no one reads them. Looks like it is easier to remove experimental examples completely :)
[image: Inline images 1]
BlSelectionExamples don't seem to support... selection ha ha
Sorry, I don't understand
From the Bloc Example browser: - running an example via the context menu shortcut resets the list selection and scrolling starts from the first item - running an example via the context menu via the mouse resets the list scroll to the beginning
No, they don't. You have a very old version of Gt-Examples :) â Bloc-ExamplesBrowser.mov <https://drive.google.com/file/d/1K56ro65dDTTf85EVGdzEBoyfH4eVbjtk/view?usp=d...> â Cheers, Alex On 26 November 2017 at 06:00, Aliaksei Syrel <alex.syrel@gmail.com> wrote:
[image: Inline images 1]
Cheers, Alex
On 26 November 2017 at 05:59, Aliaksei Syrel <alex.syrel@gmail.com> wrote:
You should do a fresh Bloc install, because it looks like you only updated Bloc from iceberg. Bloc depends on other projects such as Sparta or Beacon. About examples: gtExamples are not necessarily return instance of BlElement, it is a general all-purpose framework developed independently from Bloc.
There are so many complains about absence of class comments, but no one reads them. Looks like it is easier to remove experimental examples completely :)
[image: Inline images 1]
BlSelectionExamples don't seem to support... selection ha ha
Sorry, I don't understand
Aliaksei Syrel wrote
No, they don't. You have a very old version of Gt-Examples :)
I'm flummoxed. I downloaded a fresh Pharo 7 image via launcher, checked that my local Bloc clone had the latest commits, and ran the "bleeding edge" installation script from the README, namely: Metacello new baseline: 'Bloc'; repository: 'github://pharo-graphics/Bloc/src'; load: #core While I love what git (via e.g. GH) has made available especially regarding social coding, at this point, I feel like I have no idea how to install things. The results usually seem opaque and surprising :/ ----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
I am not sure I understand: Do you confirm that examples work properly for you? Cheers, Doru
On Nov 26, 2017, at 5:51 PM, Sean P. DeNigris <sean@clipperadams.com> wrote:
Aliaksei Syrel wrote
No, they don't. You have a very old version of Gt-Examples :)
I'm flummoxed. I downloaded a fresh Pharo 7 image via launcher, checked that my local Bloc clone had the latest commits, and ran the "bleeding edge" installation script from the README, namely: Metacello new baseline: 'Bloc'; repository: 'github://pharo-graphics/Bloc/src'; load: #core
While I love what git (via e.g. GH) has made available especially regarding social coding, at this point, I feel like I have no idea how to install things. The results usually seem opaque and surprising :/
----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
-- www.tudorgirba.com www.feenk.com "If you interrupt the barber while he is cutting your hair, you will end up with a messy haircut."
Tudor Girba-2 wrote
I am not sure I understand
What I mean is that I followed that process before when I reported all those bugs and if IIUC the responses I wasted my time because I was using old versions and reporting bugs that had already been fixed. ----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
Aliaksei Syrel wrote
No, they don't. You have a very old version of Gt-Examples :)
How do I get an image with the behavior in the video? I documented my steps. Where am I going wrong? ----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
Hi,
On Nov 27, 2017, at 12:38 AM, Sean P. DeNigris <sean@clipperadams.com> wrote:
Aliaksei Syrel wrote
No, they don't. You have a very old version of Gt-Examples :)
How do I get an image with the behavior in the video? I documented my steps. Where am I going wrong?
In your description, you checked that you have the latest version of Bloc on the local disk. GToolkit-Examples is in another repository: pharo-local/iceberg/feenkcom/gtoolkit-examples. The simplest way to ensure that you do get the latest versions is to delete the whole pharo-local/iceberg folder and then try re-loading the code in a fresh image. Please let us know if you encounter problems. Cheers, Doru
----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
-- www.tudorgirba.com www.feenk.com "Obvious things are difficult to teach."
Aliaksei Syrel wrote
There are so many complains about absence of class comments, but no one reads them. Looks like it is easier to remove experimental examples completely :)
I don't understand. I specifically skipped reporting BlExperimentalExamples failures because of that comment. ----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
Aliaksei Syrel wrote
So one would change the `loop: 1` in your example to `beInfinite`? ... Also, what is the lifetime of an infinite animation?
It can only be stopped by sending #stop to it.
Is holding it weakly from the element and sending #stop enough for the animation to be garbage collected? ----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
Hi Sean, Yes, after animation is stopped it is removed from the animation manager and if referenced weakly should be garbage collected. Otherwise it is a bug :) Cheers, Alex On 2 December 2017 at 04:48, Sean P. DeNigris <sean@clipperadams.com> wrote:
Aliaksei Syrel wrote
So one would change the `loop: 1` in your example to `beInfinite`? ... Also, what is the lifetime of an infinite animation?
It can only be stopped by sending #stop to it.
Is holding it weakly from the element and sending #stop enough for the animation to be garbage collected?
----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
Aliaksei Syrel wrote
Yes, after animation is stopped it is removed from the animation manager and if referenced weakly should be garbage collected. Otherwise it is a bug :)
I changed the clock example code from `loop: 1` to `beInfinite` and opened a bunch of clocks. Now, in a fresh playground: <http://forum.world.st/file/t128965/Screenshot_2017-12-02_09.jpeg> ----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
Hi Sean, The way I understand it is that the animation has to be stopped for the animation to be removed. If you make it to never stop, it will never be removed. Cheers, Doru
On Dec 2, 2017, at 3:37 PM, Sean P. DeNigris <sean@clipperadams.com> wrote:
Aliaksei Syrel wrote
Yes, after animation is stopped it is removed from the animation manager and if referenced weakly should be garbage collected. Otherwise it is a bug :)
I changed the clock example code from `loop: 1` to `beInfinite` and opened a bunch of clocks.
Now, in a fresh playground: <http://forum.world.st/file/t128965/Screenshot_2017-12-02_09.jpeg>
----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
-- www.tudorgirba.com www.feenk.com "Being happy is a matter of choice."
Aliaksei Syrel wrote
... Also, what is the lifetime of an infinite animation? ... Do you have any particular use-case for animations?
I hacked together a simplified stepping animation (may not be in the right place in the class hierarchy). Here's a pull request to discuss https://github.com/pharo-graphics/Bloc/pull/37 ----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
Hi, An object that is called now "Animation" in Bloc is not necessarily bound to the visual element. The correct name for the root class of "BlBaseAnimation" should be "BlPostAction" - a valuable that is guaranteed to be evaluated in the beginning of every frame before anything else. We have already a deferred action but they are only evaluated when there is enough time between frames. "BlBaseAnimation" should be renamed to something line "BlElementAnimation" that is guaranteed to be bound to a visual element and stops itself if element is no more in the scene graph *by checking that explicitly before doing every animation step*. Cheers, Alex On 2 December 2017 at 16:35, Sean P. DeNigris <sean@clipperadams.com> wrote:
Aliaksei Syrel wrote
... Also, what is the lifetime of an infinite animation? ... Do you have any particular use-case for animations?
I hacked together a simplified stepping animation (may not be in the right place in the class hierarchy). Here's a pull request to discuss https://github.com/pharo-graphics/Bloc/pull/37
----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
I forgot to mention that "BlPostAction" is a one time action - it disappears once done :) Cheers, Alex On 2 December 2017 at 17:26, Aliaksei Syrel <alex.syrel@gmail.com> wrote:
Hi,
An object that is called now "Animation" in Bloc is not necessarily bound to the visual element. The correct name for the root class of "BlBaseAnimation" should be "BlPostAction" - a valuable that is guaranteed to be evaluated in the beginning of every frame before anything else. We have already a deferred action but they are only evaluated when there is enough time between frames. "BlBaseAnimation" should be renamed to something line "BlElementAnimation" that is guaranteed to be bound to a visual element and stops itself if element is no more in the scene graph *by checking that explicitly before doing every animation step*.
Cheers, Alex
On 2 December 2017 at 16:35, Sean P. DeNigris <sean@clipperadams.com> wrote:
Aliaksei Syrel wrote
... Also, what is the lifetime of an infinite animation? ... Do you have any particular use-case for animations?
I hacked together a simplified stepping animation (may not be in the right place in the class hierarchy). Here's a pull request to discuss https://github.com/pharo-graphics/Bloc/pull/37
----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
Aliaksei Syrel wrote
should be "BlPostAction" - a valuable that is guaranteed to be evaluated in the beginning of every frame before anything else.
That name and definition do not seem to fit to me. "Post" in what sense? Why is "action" more accurate than "animation"? Aliaksei Syrel wrote
and stops itself if element is no more in the scene graph *by checking that explicitly before doing every animation step*.
I'd be interested in the performance cost of this approach, especially for an example like Squeak's infection modelling morph⦠----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
Hi Aliaksei Read again this sentence :) "BlPostAction" - a valuable that is guaranteed to be evaluated in the beginning of every frame before anything else. MAy be BlPostAction should be renamed BlEarlyAction On Sat, Dec 2, 2017 at 5:26 PM, Aliaksei Syrel <alex.syrel@gmail.com> wrote:
Hi,
An object that is called now "Animation" in Bloc is not necessarily bound to the visual element. The correct name for the root class of "BlBaseAnimation" should be "BlPostAction" - a valuable that is guaranteed to be evaluated in the beginning of every frame before anything else. We have already a deferred action but they are only evaluated when there is enough time between frames. "BlBaseAnimation" should be renamed to something line "BlElementAnimation" that is guaranteed to be bound to a visual element and stops itself if element is no more in the scene graph by checking that explicitly before doing every animation step.
Cheers, Alex
On 2 December 2017 at 16:35, Sean P. DeNigris <sean@clipperadams.com> wrote:
Aliaksei Syrel wrote
... Also, what is the lifetime of an infinite animation? ... Do you have any particular use-case for animations?
I hacked together a simplified stepping animation (may not be in the right place in the class hierarchy). Here's a pull request to discuss https://github.com/pharo-graphics/Bloc/pull/37
----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
On 5 December 2017 at 05:19, Stephane Ducasse <stepharo.self@gmail.com> wrote:
Hi Aliaksei
Read again this sentence :)
"BlPostAction" - a valuable that is guaranteed to be evaluated in the beginning of every frame before anything else.
MAy be BlPostAction should be renamed BlEarlyAction
BlPreAction
On Sat, Dec 2, 2017 at 5:26 PM, Aliaksei Syrel <alex.syrel@gmail.com> wrote:
Hi,
An object that is called now "Animation" in Bloc is not necessarily bound to the visual element. The correct name for the root class of "BlBaseAnimation" should be "BlPostAction" - a valuable that is guaranteed to be evaluated in the beginning of every frame before anything else. We have already a deferred action but they are only evaluated when there is enough time between frames. "BlBaseAnimation" should be renamed to something line "BlElementAnimation" that is guaranteed to be bound to a visual element and stops itself if element is no more in the scene graph by checking that explicitly before doing every animation step.
Cheers, Alex
On 2 December 2017 at 16:35, Sean P. DeNigris <sean@clipperadams.com> wrote:
Aliaksei Syrel wrote
... Also, what is the lifetime of an infinite animation? ... Do you have any particular use-case for animations?
I hacked together a simplified stepping animation (may not be in the
right
place in the class hierarchy). Here's a pull request to discuss https://github.com/pharo-graphics/Bloc/pull/37
----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837. html
I love it now can we use it for a real clock? I mean do we get the warrantie that 1 min is 1 min? BTW we will have to write a nice animation chapter! So continue to explain on the list like that we will have material :) Stef On Sun, Nov 26, 2017 at 2:29 AM, Aliaksei Syrel <alex.syrel@gmail.com> wrote:
Hi Sean,
How would one do e.g. a ticking clock in Bloc?
I pushed a clock example to the #master branch (BlClockExample clock)
Stepping mechanism can be implemented using infinite animation (stepping is nothing else than a special case of animation). Below is a definition of animation used to rotate second hand by 6 degrees every second.
BlNumberTransition new onStepDo: [ :aSecond | secondHand transformDo: [ :aTransform | aTransform rotateBy: aSecond * self minuteRotationDelta - 90 ] ]; from: 0; to: 60; *by: 1;* duration: 1 minute
The code above says that we should do a number transition from 0 to 60 by 1 (0,1,2,3,4,5,6,7...60) during 1 minute. On every step we rotate our second hand by appropriate angle in degrees. -90 is needed because clock hands start from Pi/2 radians on a unit circle.
In the end we get the following animation:
[image: Inline images 1]
P.S. In attachment I also send a high quality video.
Cheers, Alex
On 25 November 2017 at 23:58, Sean P. DeNigris <sean@clipperadams.com> wrote:
Bump :)
Sean P. DeNigris wrote
How would one do e.g. a ticking clock in Bloc? The only possibly relevant example I see is BlAnimatedCursor. Is that a typical usage? One thing that I'm not sure how to translate to a BlElement is that the cursor seems to be responsible for starting and stopping the animation via #activateOn:, which doesn't exist for an element. How would one prevent an element's animation from continuing to run after a space was closed?⦠I guess I mean what is the Bloc version of #step that would enable us to do e.g. Squeak's mouse-eyes-tracking-the-cursor or Lively Kernel's clock: https://upload.wikimedia.org/wikipedia/commons/5/5e/Chromium 5.0.375.99_showing_lively_kernel_using_gtk%2B_theme.png
----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
participants (6)
-
Aliaksei Syrel -
Ben Coman -
Nicolai Hess -
Sean P. DeNigris -
Stephane Ducasse -
Tudor Girba