Pergunta

Is there a way to customize the buttons for Dialog?

Dialog confirm has two buttons (yes/no), but I would like to change the value of the buttons to something else other than (yes/no).

I have been looking for ways to do this, but the given Dialog methods are very limited in terms of having customizable buttons.

Foi útil?

Solução

Try this:

Dialog choose: 'What is your choice?'
    labels: #('Red' 'Black')
    values: #(#red #black)
    default: #red

Outras dicas

I don't currently have access to a VisualWorks environment, but I seem to recall something along the lines of Dialog#choose:from:values: where you can pass in the dialog text, any button texts and the associated values, respectively. (There may be a few more arguments as well.)

Just browse the Dialog class (and its hierarchy) and you should be able to find such methods.

If no such method exists, it should be fairly easy to roll your own. It's Smalltalk, after all.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top