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.
We cannot reference Morphic directly here.
It should be usable in Gtk also
There was a problem hiding this comment.
Ok nevermind ill do this
|
|
||
| SpInformDialog new | ||
| label: self messageText; | ||
| openDialog. |
There was a problem hiding this comment.
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.
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.
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.
There was a problem hiding this comment.
yeah, this is bad.
also I do not understand where actForSpec is used. That method should not exist at all.
|
so should I close this PR? or do we let it simply rot? |
| UIManager default | ||
| inform: self messageText. | ||
|
|
||
| SpApplication defaultApplication inform: self messageText. |
There was a problem hiding this comment.
yeah, this is bad.
also I do not understand where actForSpec is used. That method should not exist at all.
-Called a
GrowlMorphto not have a UIManager call inSpInvalidUserInputErrorFixes pharo-project/pharo#15431 on pharo repo