Skip to content
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

Missing method on SpAbstractWidgetPresenter to update the visual state that depends on the enabled block #1561

Open
koendehondt opened this issue Jun 18, 2024 · 2 comments

Comments

@koendehondt
Copy link
Contributor

See #1559.

Given that SpAbstractWidgetPresenter>>#enabled: can take a block:

enabled: aBooleanOrValuable
	"Set if the widget is enabled (clickable or focusable).
	This can either be a boolean or a block returning a boolean."

	enabled := aBooleanOrValuable

as in:

presenter := SpPresenter new.
button := SpButtonPresenter new
	icon: (presenter iconNamed: #smallSave);
	enabled: [ false ];
	action: [ "do something" ];
	yourself.
presenter layout: (SpBoxLayout newLeftToRight
	add: button;
	yourself).
presenter open

SpAbstractWidgetPresenter should have a method, e.g. refresh, to update the visual state of an instance, so that the condition in the enabled block is evaluated again.

@Ducasse
Copy link
Contributor

Ducasse commented Jun 19, 2024

Koen I thought about introducing a tag for book. What do you think? Like that we can help esteban knowing that this is important for the book.

@koendehondt
Copy link
Contributor Author

koendehondt commented Jun 19, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants