Bloc Feedback

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

Bloc Feedback

Sean P. DeNigris
Administrator
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

Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Bloc Feedback

Aliaksei Syrel
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 <[hidden email]> 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


Reply | Threaded
Open this post in threaded view
|

Re: Bloc Feedback

Tudor Girba-2
In reply to this post by Sean P. DeNigris
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 <[hidden email]> 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."





Reply | Threaded
Open this post in threaded view
|

Re: Bloc Feedback

Aliaksei Syrel
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

Inline images 1

Cheers,
Alex

On 23 October 2017 at 09:49, Tudor Girba <[hidden email]> 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 <[hidden email]> 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."






Reply | Threaded
Open this post in threaded view
|

Re: Bloc Feedback

Sean P. DeNigris
Administrator
In reply to this post by Tudor Girba-2
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

Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Bloc Feedback

Nicolai Hess-3-2


2017-10-24 2:04 GMT+02:00 Sean P. DeNigris <[hidden email]>:
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
 

Reply | Threaded
Open this post in threaded view
|

Re: Bloc Feedback

Tudor Girba-2
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 <[hidden email]> wrote:
>
>
>
> 2017-10-24 2:04 GMT+02:00 Sean P. DeNigris <[hidden email]>:
> 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."


Reply | Threaded
Open this post in threaded view
|

Re: Bloc Feedback

Aliaksei Syrel
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
Inline images 1

A bit longer answer would require to read the following document 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!

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 <[hidden email]> 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 <[hidden email]> wrote:
>
>
>
> 2017-10-24 2:04 GMT+02:00 Sean P. DeNigris <[hidden email]>:
> 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."



Reply | Threaded
Open this post in threaded view
|

Re: Bloc Feedback

Sean P. DeNigris
Administrator
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

Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Bloc Feedback

Tudor Girba-2
Hi Sean,

> On Oct 25, 2017, at 2:14 PM, Sean P. DeNigris <[hidden email]> 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."





Reply | Threaded
Open this post in threaded view
|

Re: Bloc Feedback

Sean P. DeNigris
Administrator
In reply to this post by Sean P. DeNigris
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_showing_lively_kernel_using_gtk%2B_theme.png





-----
Cheers,
Sean
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html

Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Bloc Feedback

Aliaksei Syrel
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:

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 <[hidden email]> 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/Chromium5.0.375.99_showing_lively_kernel_using_gtk%2B_theme.png


Bloc-Clock.mov (2M) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Bloc Feedback

Sean P. DeNigris
Administrator
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

Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Bloc Feedback

Aliaksei Syrel
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 <[hidden email]> 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?

Reply | Threaded
Open this post in threaded view
|

Re: Bloc Feedback

Aliaksei Syrel
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
Reply | Threaded
Open this post in threaded view
|

Re: Bloc Feedback

Sean P. DeNigris
Administrator
In reply to this post by Aliaksei Syrel
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

Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Bloc Feedback

Aliaksei Syrel
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 :)

Inline images 1


BlSelectionExamples don't seem to support... selection ha ha
Sorry, I don't understand 
Reply | Threaded
Open this post in threaded view
|

Re: Bloc Feedback

Aliaksei Syrel
Inline images 1

Cheers,
Alex

On 26 November 2017 at 05:59, Aliaksei Syrel <[hidden email]> 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 :)

Inline images 1


BlSelectionExamples don't seem to support... selection ha ha
Sorry, I don't understand 

Reply | Threaded
Open this post in threaded view
|

Re: Bloc Feedback

Aliaksei Syrel
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 :)


Cheers,
Alex

On 26 November 2017 at 06:00, Aliaksei Syrel <[hidden email]> wrote:
Inline images 1

Cheers,
Alex

On 26 November 2017 at 05:59, Aliaksei Syrel <[hidden email]> 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 :)

Inline images 1


BlSelectionExamples don't seem to support... selection ha ha
Sorry, I don't understand 


Reply | Threaded
Open this post in threaded view
|

Re: Bloc Feedback

Stephane Ducasse-3
In reply to this post by Aliaksei Syrel
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 <[hidden email]> 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:

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 <[hidden email]> 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/Chromium5.0.375.99_showing_lively_kernel_using_gtk%2B_theme.png


12