Search code examples
smalltalkpharo

How do I call a Yes / No / Cancel dialog in Pharo 4.0?


This question is related to How do I ask the user for a file name?

The issue of 'Standard dialogs'.

How do I call a Yes / No / Cancel dialog and how to I call an alert in Pharo 4.0?


Solution

  • You can use

    UIManager default question: 'foo' title: 'bar'.
    

    which answers true for Yes, false for No, and nil for Cancel.

    Similarly, an alert can be shown like this:

    UIManager default alert: 'Hello World'.