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
ToLabel doesn't update on model change #29
Comments
BTW, it may make sense to create a superclass in common for these BlText change announcements. |
Talking with Enzo I realized the basic textElement :=
BlTextElement new
text: 'A' asRopedText;
yourself.
textElement openInNewSpace.
textElement text
when: BlTextStringsInserted send: #textChanged to: textElement;
when: BlTextsDeleted send: #textChanged to: textElement;
when: BlTextAttributeAdded send: #textChanged to: textElement;
when: BlTextAttributesRemoved send: #textChanged to: textElement.
[ 10 timesRepeat: [
| aRandomSize |
aRandomSize := (SharedRandom globalGenerator nextIntegerBetween: 1 and: 10) * 30.
textElement text fontSize: aRandomSize.
0.5 seconds wait ] ] fork |
I mean, the |
I'm not sure. I should check further why it is not already done like that. Btw, the model stuff should not be used. I'm not sure these classes will remain in the futur (except for ToAlbum). Maybe spec adapters will play the role of these kind of view-model |
I do |
Hi, Working in Spec-Toplo, created a subclass of
to fix this problem |
@labordep okay, it's the approach as a List widget, that isn't subscribed to the items collection changes... I mean, similarly, the user has the responsibility to tell the widget it was to refresh. |
hello @tinchodias |
Yes, it's a valid objection. I could rollback if it was really bad idea. The requirements from Spec to adapt a
|
it's good to implement spec adapters. we can see was is lacking. regarding enable/disable, it will be integrated for all widgets. The look change will be implemented through a theme/skin mechanism. |
Anyway, continue with subclassing. finally it is good as we can immediately see what is wrong or lacking :) |
@plantec do you want that I push the enable and string API to ToLabel? or I continue with this approach with Spec backend and we push them before |
Hi! I had a conversation with @labordep about this behavior that I consider a bug in ToLabel but may be not... so I'm reporting it to know @plantec opinion.
Code:
Then evaluate any of these lines:
And the label only refreshes after sending
aToLabel textChanged
.I saw that foreground: announces BlTextAttributeAdded, and looking for references I discovered that AlbTextEditor subscribes to it, to react. So that may be the fix.
In the previous snippet, I added:
and it was fixed.
The text was updated successfully, but these errors were encountered: