Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions HelpSource/Classes/EmacsButton.schelp
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
TITLE:: EmacsButton
summary:: Button widget
categories:: Frontends>Emacs
related:: Classes/EmacsBuffer, Classes/EmacsWidget


DESCRIPTION::
Emacs button widget.


CLASSMETHODS::

METHOD:: new

ARGUMENT:: buffer
An link::Classes/EmacsBuffer:: into which the widget should be placed. The widget will be positioned at the current cursor location.

ARGUMENT:: states
An link::Classes/Array:: of labels defining the states of the button.

ARGUMENT:: action
The function which will be evaulated on button press.

ARGUMENT:: prefix
Left border of button. A string.

ARGUMENT:: suffix
Right border of button. A string.



INSTANCEMETHODS::

METHOD:: states
Gets / sets widget's states.

METHOD:: value
Gets / sets widget's value.

METHOD:: action
Gets / sets widget's action.

EXAMPLES::

code::
p = EmacsBuffer.new;
p.front;


b = EmacsButton( p, [ "on", "off", "in between" ], { |v| ("State: "++v).postln; }, "|", "|" );

b.value
b.value = 2
b.states
p.free;
::