-
Notifications
You must be signed in to change notification settings - Fork 68
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
base: Pharo13
Are you sure you want to change the base?
Reduced UIManager api #1751
Conversation
-Called a ```GrowlMorph``` to not have a UIManager call in ```SpInvalidUserInputError```
UIManager default | ||
inform: self messageText. | ||
|
||
GrowlMorph new |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed!
@AlexisCnockaert
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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.
-Called a
GrowlMorph
to not have a UIManager call inSpInvalidUserInputError
Fixes pharo-project/pharo#15431 on pharo repo