ContainedButton - hpi-swa-teaching/MaterialDesignWidgets GitHub Wiki

class MDContainedButton

You can create a TextButton by simply calling MDContainedButton new openInHand. This will show the default ContainedButton.

To create a basic custom MDContainedButton you might want to use something like the following:

MDContainedButton new
    text: 'Change my color';
    backgroundColor: '#2196F3';
    target: [ self backgroundColor: Color blue ];
    actionSelector: #value;
    openInHand

Customizing a MDContainedButton

Appearance
  • text: aString set the button's text
  • textColor: aStringOrColor set the text's color
  • backgroundColor: aStringOrColor set the background color
Actions
  • target: anObject set the target the message actionSelector will be send to
  • actionSelector: aSymbolOrString set the message which will be send to target
  • arguments: aCollection set the arguments for the message actionSelector which be send to target
  • state enable makes the button clickable default
  • state disable prevents the button from being clicked