Domanda

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.

È stato utile?

Soluzione

Try this:

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

Altri suggerimenti

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top