Reputation: 13396
Is it possible to display an alert for user in an easy way? Something like:
save
title
ifEmpty: [ 'Title cannot be empty' alert ]
ifNotEmpty: [ "…do the saving…" ]
so that if title
ivar will be empty user will see the dialog with appropriate message.
Upvotes: 0
Views: 194
Reputation: 801
You can (somewhat) tweak the dialog window before showing it up with a block.
Like centering it on screen with a red border.
UIManager default
alert: 'Something is wrong'
title: 'Issue ahead'
configure: [ :d | d position: Display center; borderColor: Color red].
Upvotes: 2
Reputation: 2002
yes it is
for a typical error dialog you can use this piece of code
UIManager default abort: 'Title cannot be empty'.
for a growl messages that the user has not to click on ok button you can use this
UIManager default inform: 'Data has been saved'.
UIManager has actually a lot of options on this and a lot of messages you can use. Just explore the class and I am sure you will find something that fits your needs.
Upvotes: 0
Reputation: 4357
it would be:
self inform: 'Title cannot be empty'
but to be honest, I'm not happy with it, because is like a growl notification.
Most of the time, that's exactly what you want, but some times you need a modal notification... anyway, that's what you need :)
Upvotes: 1