TextButton - hpi-swa-teaching/MaterialDesignWidgets GitHub Wiki

class MDTextButton

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

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

MDTextButton new
    text: 'Change my text';
    textColor: '#2196F3';
    target: [ self text: 'Button Clicked' ];
    actionSelector: #value;
    openInHand.

Customizing a MDTextButton

Appearance
  • text: aString set the button's text
  • textColor: aStringOrColor set the text's 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 to be send to target
  • state enable makes the button clickable default
  • state disable prevents the button from being clicked