[Pharo-dev] [Moose-dev] How ready is Bloc for a simple use-case?

Aliaksei Syrel alex.syrel at gmail.com
Wed Feb 22 16:02:28 EST 2017


Hi Peter

 I wanted to ask about Bloc:

Thanks for your interest :)

1) how stable is the API? e.g. if some overhaul changes to unify/whatever
> are planned


Api itself is in "final" state, however naming might be improved (changed
with or without depreciations). But don't worry user-side api is already in
a very good shape, at least from our perspective :)

2) I saw in the techtalk that you can align elements (to center, bottom,
> ...), however is that possible with lines? Lines have to rotate, morph
> shape, etc.

3) Are non-straight lines possible? (e.g. bezier, arc)


Exactly :) Lines are just bloc elements as anything else: buttons, text
images. They can be linear, can be arcs or bezier curves (both quadratic or
cubic). Default canvas used for rendering in Bloc (SpartaCanvas) has very
good support of vector shapes and lines.

 The idea for me is to make a simple mindmap
>         - elements with some text, icons, math symbols inside
>         - connectors (non-straight lines) between elements


It is very doable. Please, don't forget that Bloc is a low level framework
that does not contain any widgets (existing ones will be deleted,
especially BlLine, BlText and BlTextElement). The only responsibility Bloc
has is to provide a basic infrastructure that does not put any constraints
on users. Which means that if you want to have a bezier line you have to
subclass BlElement, implement corresponding accessors for anchor points and
override drawPathOnSpartaCanvas: in order to display you line. You can
learn more about canvas by checking SpartaCanvas class comment and method
comments in 'api' protocol.

Layouts, alignment, transformations are part of bloc and are available to
all subclasses of BlElement.

Cheers,
Alex

On 22 February 2017 at 21:32, Peter Uhnak <i.uhnak at gmail.com> wrote:

>  Hi,
>
>  I wanted to ask about Bloc:
>
>  1) how stable is the API? e.g. if some overhaul changes to unify/whatever
> are planned
>  2) I saw in the techtalk that you can align elements (to center, bottom,
> ...), however is that possible with lines? Lines have to rotate, morph
> shape, etc.
>  3) Are non-straight lines possible? (e.g. bezier, arc)
>
>  The idea for me is to make a simple mindmap
>         - elements with some text, icons, math symbols inside
>         - connectors (non-straight lines) between elements
>
>  To me (apart from the lines) it seems like it should be already doable.
>
>  Also either my (Morphic) Pharo is really slow, or Bloc (in the video) is
> superfast (everything is happening instantly).
>
>  Thanks,
>  Peter
> _______________________________________________
> Moose-dev mailing list
> Moose-dev at list.inf.unibe.ch
> https://www.list.inf.unibe.ch/listinfo/moose-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20170222/06928d76/attachment.html>


More information about the Pharo-dev mailing list