From 5b65f70940b6b7d7232f9d1e17f9f9c03cdfd861 Mon Sep 17 00:00:00 2001 From: paum3 Date: Tue, 26 Dec 2023 11:03:22 +0100 Subject: [PATCH] new documetation file for EmacsButton --- HelpSource/Classes/EmacsButton.schelp | 56 +++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 HelpSource/Classes/EmacsButton.schelp diff --git a/HelpSource/Classes/EmacsButton.schelp b/HelpSource/Classes/EmacsButton.schelp new file mode 100644 index 0000000..acfbaf5 --- /dev/null +++ b/HelpSource/Classes/EmacsButton.schelp @@ -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; +::