File: EmacsGUI.schelp

package info (click to toggle)
supercollider 1%3A3.10.0%2Brepack-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 45,496 kB
  • sloc: cpp: 283,513; lisp: 74,040; ansic: 72,252; sh: 23,016; python: 7,175; makefile: 1,087; perl: 766; java: 677; yacc: 314; lex: 175; ruby: 136; objc: 65; xml: 15
file content (100 lines) | stat: -rw-r--r-- 2,222 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
title:: Emacs GUI
summary:: Emacs user interfaces
categories:: Frontends

The Emacs interface actually has some nice options for user interfaces as well. Here are some examples:
code::
// create a buffer:
p = EmacsBuffer.new;

// show the buffer:
p.front;

// create a key action for the buffer:

p.defineKey( "hello", { "hey there".postln; } );

// type hello on the window and look at the postbuffer
p.front;

p.defineKey( "hey there", { "hello".postln; } );

// type hey there and look at the postbuffer
p.front;

// put some text in the buffer:

p.insert( "this is a really interesting text to read in the buffer" );
p.front;

// make a newline:

p.newline;

// make a button:

p.button( [ "on", "off", "in between" ], { |v| v.postln; } );
p.front;

// make a button with a different look:
p.button( [ "on", "off", "in between" ], { |v| v.postln; }, "******", "+++++" );
p.front;

// create a close button:
p.closeButton;
// clicking it will close the buffer!

p = EmacsBuffer.new;

p.editableField( "write something here", "like this?", { |v| v.postln; } );
p.front;

// moving the cursor around in the buffer:
p.gotoBob; // beginning
p.gotoEob; // end
p.goto( 5 ); // go to fifth position

// making it a sclang-mode buffer to write code in:
Emacs.evalLispExpression( p.use( [ 'sclang-mode' ] ).asLispString );

// close it:
p.free;

//

p = EmacsBuffer.new; // args: name
p.front;

// making a number box
n = EmacsNumber.new( p, "number box", [0,5].asSpec, { |v| v.postln; } ); // args: buffer, tag/label, spec, action
p.front;

// making a button:
x = EmacsButton( p, [ "on", "off", "in between" ], { |v| v.postln; }, "******", "+++++" );
// args: buffer, states, action, prefix, suffix
p.front;

t = EmacsText( p, "hello", 30 ); // args: buffer, string, size, align
p.front;

p.newline;
t = EmacsText( p, "helloooo", 30, \right ); // args: buffer, string, size, align

p.newline;
e = EmacsEditableField( p, "edit field", "edit me" ).action_( { |v| v.postln; } );
p.front;

b = EmacsPushButton( p, "hello" ).action_( { "do it".postln; } );
p.front;

// you can disable things:

b.enabled_( false );
p.front;
::

And last but not least, it provides a class browser:
code::
EmacsClassBrowser.new( EmacsBuffer );
::