It is indeed logical :) However, in most UI of applications (in web, mobile) it is extremely rare that clipping or event handling areas differ from drawing one (visual one - one that user sees in the end). Do you agree with that and also that in most cases we want to change them all together just sending one message? :) Cheers On Apr 3, 2016 12:20 PM, "Denis Kudriashov" <[hidden email]> wrote:
|
On 3 April 2016 at 13:27, Aliaksei Syrel <[hidden email]> wrote:
But wait, what i saw in this thread: Stef presented a simple use case - he wants to draw a rectangle plus circle or a line.. and got lost.. confused and frustrated. And i am far to see how such use case can be called something exceptionally rare. Do you? The goal of good design is to make common cases extremely simple, non-common cases - harder. But not impossible. And by impossible i mean not that you cannot do anything by yourself, but what you can do using existing framework. The fact that i can override and rewrite anything and make it my way - is not a valid argument. Yes, i made a slight detour in discussion, to demonstrate that actually single shape per morph is no go.. And there's multiple shapes can be involved and each for own role. And allowing only a single one feels a bit limiting, as to me. But of course i understand, that it is not so common, except when i wanna draw a label on top of background, which requires at least two shapes. :) As for clipping/ui shapes, i don't understand, it is really not that hard to do, i.e.: clippingShape ^ clippingShape ifNil: [ self shape ] .. which means you can still have a single shape by default, but in case you need - here you go, you free to define own. But anyways.. All i want is to be convinced that my fears are not that bad. Btw, i have a question about your statement, quote:
Hmm. At least in Athens, by design AthensPath is a shape. It is a shape, that is drawn by Athens. Path is just a single concrete case how you could define a shape. Rectangle is another one.. And there's no limitation in Athens, what may represent a shape, as long as it conforms to AthensShape protocol, which also means, if you look at it, it has #paintFillsUsing:on: , which implies, that it actually should know how to draw itself. And of course, since it knows what areas it covers it has insights about own geometry.. but such details are not exposed to outside, since it would be very hard to encode all possible ways to represent shape(s) by some kind of common data, like paths. Are you talking about Bloc shapes? Then it is indeed a pity, if such statement are correct in terms of Bloc. Because then it introducing another kind of shapes in addition to existing kind of shapes introduced by Athens.. something different and not really compatible. Which serves as a source of confusion. I am not arguing, maybe such thing was necessary, but i would, at least then call it different to avoid potential confusion.
Best regards,
Igor Stasenko. |
In reply to this post by Aliaksei Syrel
On 3 April 2016 at 13:14, Aliaksei Syrel <[hidden email]> wrote:
Thank you, Aliaksei. If you have an impression that i came here to troll you or to argue just for the sake of arguing and wasting your time, please trust me, i am not. I spent a lot of time thinking about this stuff and making it and discussing it over and over again with many people, including Alain, Stef and others.. and so, i am not a stranger that passing by, i honestly want to see it fly, be smooth and elegant , close to perfect, but not crawl on a set of kludges.
Best regards,
Igor Stasenko. |
In reply to this post by Igor Stasenko
I completely agree with you now, Igor :) The idea that I proposed during Pharo days is to make BlShape polymorphic with what athens have. I did not implement it yet I work on it just right now. I suppose that I explained me wrong to Stef and he started thinking that it is already implemented. On my road back from Pharo days I started working on what Stef wanted to do yesterday. I my example I just wanted to show Stef how he can solve his problem just right now, without saying "Oh, Stef, you know, please wait one more week". Also that was the idea why I started implementing own implementation of Athens Api and named it Sparta. Specifically to remove amount of shapes/pathes/paints used in Bloc. I was planning to finish it before I send an announcement email to pharo mailing list saying officially that bloc is released to alpha. I discussed it on Pharo days and we agreed to wait until announcement. And now I'm frustrated that people don't listen to me and try to use product before official release just in the middle of refactoring. What you are stating in this discussion will be implemented early or later. |
In reply to this post by Denis Kudriashov
On 3 April 2016 at 13:18, Denis Kudriashov <[hidden email]> wrote:
In short, i see only two cases where indeed, morph requires a nothing of shapes to define: - clipping region(s) - ui interaction region(s) but for drawing? nooooo... really? who cares what you draw there? draw anything, in any possible way you see fit.. compose, decompose, recombine, blend and mix.. that's the whole purpose of drawing and be artistic and be able to express yourself in any possible way you want :) Why nailing and formalizing things that are tend to be hardly formalizable and more than that, unnecessary. That's my main concern about current design. Best regards,
Igor Stasenko. |
On 3 April 2016 at 14:44, Igor Stasenko <[hidden email]> wrote:
s/nothing/notion
Best regards,
Igor Stasenko. |
In reply to this post by Aliaksei Syrel
On 3 April 2016 at 14:37, Aliaksei Syrel <[hidden email]> wrote:
Can you shed more light on this? I need your motivation/reasoning behind it. I tried in Athens to keep a minimal set of protocol(s), so that there's no need to learn numerous methods to start using it. The shapes/paints thing is central in Athens.. so, if you see how it can be made even simpler, i am all ears to hear details. In any case, what i can tell from your statement above is to remove unnecessary bloat.. which is always welcome. But why that requires changes in Athens API, instead of changes in Bloc?
No, i am not using it, yet.. The only 'people' was Stef himself :)
Best regards,
Igor Stasenko. |
In reply to this post by Aliaksei Syrel
2016-04-03 12:27 GMT+02:00 Aliaksei Syrel <[hidden email]>:
I agree. But Igor shows trivial example: label with rectangle background. |
2016-04-03 14:23 GMT+02:00 Denis Kudriashov <[hidden email]>: I agree. But Igor shows trivial example: label with rectangle background. I remember in PharoDays you show text with different background shapes. It was composition of elements? |
In reply to this post by Aliaksei Syrel
Hi,
It is the same for desktop UI (Qt, JavaFx,...). I think the misunderstanding come from "shape", so let us forget BlShape and concentrate on BlElement. In fact, using Bloc now, If we want a Rectangle with an clickable inner Circle, we have to defined 2 elements, the Rectangle one and the Circle one (subclass of BlElement or using script style). The CircleElement must be the child of the RectangleElement but we don't have to override any method or to rewire CircleElement events back to its parent, we just need to add an event listener to the CircleElement from where we want. It is the same with a Text in a Rectangle, we need a BlElement for the Text and another for the Rectangle in order to compose them and to position the Text in the Rectangle. For me its like defining a CircleButton in a RectanglePanel with any other ui libraries, i can do that by subclassing Panel or by using script style. But i have to manipulate 2 elements and it makes sense for me. Bloc does not provide user-friendly high-level abstractions at BlShape or BlElement level like BlCircleShape or BlCircleElement. I don't know if it is the right place to add them but it is clearly a point of misunderstanding when people uses Bloc. It seems to me that Bloc is not made to be used direclty as a graphical framework but it is a librarie to build more user-friendly graphical framework. Shape, Path, ... are implementations stuff, most of users should not care about that using a "framework". PS: @Alex, what are the planned refactoring? I'm lost in the new intentions and in the roadmap of Bloc... Regards, Glenn.
Glenn Cavarlé
|
On 3 April 2016 at 15:28, Glenn Cavarlé <[hidden email]> wrote: Hi, It seems to me that Bloc is not made to be used direclty as a graphical Thanks for explanation.. Now i have a hard time understanding, what is the purpose of so-called 'element'. Element of what? What its role? What its interaction between morphs and shapes, and what you see & feel on the screen? From your description, what i can tell is that it is completely unnecessary. You have morphs to define hierarchy/composition. And you can use shapes to define geometry for UI/clipping. As for drawing - there's no need to put any constraints, you don't have to even mention that there are shapes involved. It is indeed, an implementation detail from that perspective, since you drawing things using Athens, and it uses shapes to define affected regions. But that completely orthogonal to what happens at UI level. Thus, it is very surprising to me see following code snippet: BlCell>>initialize super initialize. self shape: (BlShape new fillPaint: (BlColorPaint new color: (Color yellow)); path: BlRectanglePath new); extent: self extent because it is really seems like encapsulation of what you gonna draw.. and putting it into #initialize method in some form? And you lost me here.. That is complete nonsense.. from any perspective. Can i unsee this code, please? :) PS: @Alex, what are the planned refactoring? I'm lost in the new intentions Best regards,
Igor Stasenko. |
On 3 April 2016 at 16:20, Igor Stasenko <[hidden email]> wrote:
<acid mode on> .. to me it feels like: okay, what we need to do, to prevent overrides of our beloved default #drawOn: method. And you talking about 'sophistication' after that? </acid mode off>
Best regards,
Igor Stasenko. |
And you lost me here.. That is complete nonsense.. from any perspective. If I would say that we have defaultShape method and it can be overridden as: defaultShape would it make you happy? .. to me it feels like: okay, what we need to do, to prevent overrides of our beloved default #drawOn: method. You are wrong concerning preventing to override drawOn :) Don't forget that there was a customer requirement concerning bloc: Can we change how morph looks on fly? Can we create a rectangle morph and change it's shape from rectangle to circle? Because it can nicely show while presenting that Pharo is live system. I'm pretty sure Stef said it once ago. Do you see how bloc story can nicely be told: We have basic UI elements and each element has shape that can be easily changed live. Shape is defined by a path which can be filled or stroked using a paint. Complex elements can be created as composition of elements with basic shapes (rectangle, circle). Isn't it beautiful? :) Cheers, Alex On Sun, Apr 3, 2016 at 3:37 PM, Igor Stasenko <[hidden email]> wrote:
|
In reply to this post by Aliaksei Syrel
Sorry aliaksei but this is not an anwser in a discussion
Le 3/4/16 11:08, Aliaksei Syrel a
écrit :
|
In reply to this post by Glenn Cavarlé
I did not want a square with a clickable circle.
I just wanted a square with a drawn circle on it and I do not understand why I should compose a new morph just for that. I did not get how draw and morph composition are working. I tried to draw the circle myself and I fall into a wrong version that I should be use story. Stef Le 3/4/16 14:28, Glenn Cavarlé a écrit : > Hi, > > Aliaksei Syrel wrote >> However, in most UI of applications (in web, mobile) it is extremely rare >> that clipping or event handling areas differ from drawing one (visual one >> - >> one that user sees in the end). > It is the same for desktop UI (Qt, JavaFx,...). > > I think the misunderstanding come from "shape", so let us forget BlShape and > concentrate on BlElement. > > In fact, using Bloc now, If we want a Rectangle with an clickable inner > Circle, we have to defined 2 elements, the Rectangle one and the Circle one > (subclass of BlElement or using script style). > The CircleElement must be the child of the RectangleElement but we don't > have to override any method or to rewire CircleElement events back to its > parent, we just need to add an event listener to the CircleElement from > where we want. > It is the same with a Text in a Rectangle, we need a BlElement for the Text > and another for the Rectangle in order to compose them and to position the > Text in the Rectangle. > > For me its like defining a CircleButton in a RectanglePanel with any other > ui libraries, i can do that by subclassing Panel or by using script style. > But i have to manipulate 2 elements and it makes sense for me. > > Bloc does not provide user-friendly high-level abstractions at BlShape or > BlElement level like BlCircleShape or BlCircleElement. > I don't know if it is the right place to add them but it is clearly a point > of misunderstanding when people uses Bloc. > > It seems to me that Bloc is not made to be used direclty as a graphical > framework but it is a librarie to build more user-friendly graphical > framework. > Shape, Path, ... are implementations stuff, most of users should not care > about that using a "framework". > > PS: @Alex, what are the planned refactoring? I'm lost in the new intentions > and in the roadmap of Bloc... > Regards, > Glenn. > > > > ----- > Glenn Cavarlé > -- > View this message in context: http://forum.world.st/bloc-shape-size-tp4887929p4888039.html > Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com. > > |
In reply to this post by Igor Stasenko
Igor I could understand that if I want a clickable rectangle I have to initialise it with such shape. Now what I could not achieve was to get a circle drawn on it. Sadly :) Stef |
In reply to this post by Igor Stasenko
If you want to change clicking behaviour you need to override one
single method.
I agree. I do not see why people are forced to create a submorph just to change the rendering. If you want to change it dynamically you can for example pass a different shape.
|
In reply to this post by Aliaksei Syrel
On 3 April 2016 at 17:58, Aliaksei Syrel <[hidden email]> wrote:
Nope. (see bottom of reply why)
Nope. Because it would be beautiful, if your statements would be reflected in reality and by reality. In your example #defaultShape method, you simply isolating some behavior into a separate method. It does not changes anything. You want to achieve to be able to change shapes on the fly. Good. A honourable goal. And welcoming. No objections here. But can we achieve it without losing being able to change the color of shape on the fly. Please? :) The way you introducing it goes straightly into conflict with: i want to be able to draw anything, the way i feel and like. You proposing a bad trade: oh yeah, you wanted to change shapes on the fly.. good.. but at cost of unable to draw anything else than simple rectangles in simple order.. Well.. i am not buying such trade. Can you sweeten a deal? The point is, that shape is not the only thing you need to put into equation in order to get thing on the screen.. You also need paint. And that's the reason why you have fillPaint: (BlColorPaint new color: (Color yellow)); (lets put aside the hardcoding of color in unrelated place (defaultShape).. for the sake of example) but does that fully covers all and any possible ways and needs of drawing? Nope! Again not.. And voila, say welcome to composite "shapes" or "elements" or call it as you like it. But does that fully covers all and any possible ways you can draw something with Athens? Nope, it is not. Again. Sorry. You can achieve that only if you completely encode all possible operations and features provided by Athens using some kind of command pattern and put them in 'element' or 'compositeElement' or 'compositeOfCompositeElementsComposition' whatever. For instance, how you going to encode AthensPaintMode into your elements? I guess you will offer to kill it with your 'it is not used so often' knife. Can't you see that you basically creating a wrapper for all Athens feature set. I can tell you that you wasting effort: you cannot get anything extra by doing it. Except from extra complexity. And for what? Something that already there and can be used out of the box. If you don't like Athens API - go on, and change it. Make it better and more convenient to use. But encapsulating all possible combinations of all possible drawing operations? Good luck with that.
Best regards,
Igor Stasenko. |
In reply to this post by stepharo
On 3 April 2016 at 18:30, stepharo <[hidden email]> wrote:
No, it doesn't sounds like that to me. It sounds like: - you can have your clickable rectangle, but only if you define a color of clickable region - "Color yellow". If you don't define color of clickable region - then system cannot derive from such incomplete data, what region is clickable and what not :)
Best regards,
Igor Stasenko. |
In reply to this post by Igor Stasenko
This means that any abstraction/wrapper around athens will fail.
What if we would remove drawingShape and by default leave drawOn: method to be empty. That way we would not put any constraints on rendering part. user just gets athens canvas and can do whatever she wants. Instead we would have only clipping shape and event area shape. What do you think? :) Cheers, Alex On Sun, Apr 3, 2016 at 6:04 PM, Igor Stasenko <[hidden email]> wrote:
|
Free forum by Nabble | Edit this page |