-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tooltip model is based on blockClosure outside context #207
Comments
the benefit of current implementation is that is is stateless |
Why being stateless is a benefit ? |
the trait is used by ToElement level as TToElementWithContextMenu so, I guess one have to limit the number of inst variables for a ToElement. |
" The advantage of having a BlockClosure is that you can generate on the fly the content of the tooltip. " "This effect could be achieve by adding new event for tooltip: |
I try to explain 2 things: firstWhat i try to explain is that you could have the same on the fly generation with events. Pros of using events is:
Cons of using events is:
If we choose to use BlEventHandler to manage the tooltips we could add events when the tooltip is not yet visible, when the tooltip is visible, when the tooltip is about to be hidden and when the tooltip is hidden. You could use all this event to manage the panel inside the tooltip.
secondThe current implementation of tooltip in Toplo relies on BlockClosure with an outside context. tooltipContent: anElement
anElement ifNil: [
self removeTooltipWindowManager.
^ self ].
self tooltipBuilder: [ :win :requestEventt |
win root addChild: anElement ]
This create high complexity for Pyramid or serialization. ConclusionI really do not like the BlockClosure, it is difficult to manage with the serialization and with Pyramid. I personally think that a block closure add hidden states to the UI that cannot be seen while reading the code. I would like to have simple Object with a simple API to manage my UI and not a BlockClosure that can do everything. But maybe there are strong arguments in favor of BlockClosure that i do not see yet. |
@Nyan11 what are the serializer(s) that Pyramid uses to serialize? I'm analysing a possible solution in Fuel using "clean" blocks. But not sure if you use Fuel. |
Hello, I used a custom one that generate executable code: https://github.com/Nyan11/Stash Currently i only check if the block closure is clean before serializing it. |
Stash looks nice! But I only saw it in the web browser. I guess I have to load Pyramid to see it in action. |
If you want to use it without loading Pyramid, you will need https://github.com/OpenSmock/Bloc-Serialization Once loaded, you can open a new space with BlElement inside, inspect one of the BlElement and modify it using the inspector. BlElement new
background: (BlPaintBackground new
paint: (BlColorPaint new
color: (Color r: 1.0 g: 0.0 b: 0.0 alpha: 1.0);
yourself);
opacity: 1.0;
yourself);
border: (BlBorderBuilder new
paint: (BlColorPaint new
color: (Color r: 0.0 g: 1.0 b: 0.0 alpha: 1.0);
yourself);
width: 7;
build);
yourself You have a similar project for Toplo: https://github.com/OpenSmock/Toplo-Serialization |
The tooltips in are managed by the trait
TToElementWithTooltip
.When you add a tooltip, you use one of the following methods:
All the methods use the
tooltipContent:
.Here is the source code of
tooltipContent:
.anElement
here is the BlElement we want to display in the tooltip.The element is not added directly in a "tooltip model" but as an outter context variable of a blockClosure.
The advantage of having a BlockClosure is that you can generate on the fly the content of the tooltip.
This effect could be achieve by adding new event for tooltip:
The text was updated successfully, but these errors were encountered: