Skip to content

Reduced UIManager api #1751

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

Open
wants to merge 4 commits into
base: Pharo13
Choose a base branch
from

Conversation

AlexisCnockaert
Copy link
Contributor

-Called a GrowlMorph to not have a UIManager call in SpInvalidUserInputError
Fixes pharo-project/pharo#15431 on pharo repo

-Called a ```GrowlMorph``` to not have a UIManager call in ```SpInvalidUserInputError```
UIManager default
inform: self messageText.

GrowlMorph new
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot reference Morphic directly here.
It should be usable in Gtk also

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use a SpDialog

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok nevermind ill do this


SpInformDialog new
label: self messageText;
openDialog.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That part is not easy. A dialog presenter is indeed better but what happens if you run your image headless?
In this case, you do not want to open a dialog but instead log the message on the console.
It is the job done by UIManager.
Currently, in Spec, there is a missing mechanism to deal with headless images.
For now, you could delegate the handling of the inform to the spec application. It already has #inform: message

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay I understood, thank you for the explanation

UIManager default
inform: self messageText.

SpApplication defaultApplication inform: self messageText.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't you have a reference to the SpApplication instance?
Because you are not sure the application that triggered SpInvalidUserInputError is the default or not. It is better to avoid the use of globals.
If you don't have it, you could pass it to SpInvalidUserInputError when creating the error.

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

Successfully merging this pull request may close these issues.

SpInvalidUserInputError MUST not refer to UIManager
3 participants