-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathINTRO
104 lines (81 loc) · 3.32 KB
/
INTRO
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
101
102
103
104
An introduction to Parrot
=========================
file: INTRO
Philip Hunt, last altered 5-Sep-1999
An introduction to the Parrot GUI building tool.
Parrot is a text-based GUI builder, written by Philip Hunt. It is
intended to be used by programmers writing GUI applications. To
use Parrot, first you create a *.par file describing your
application's GUI. Your file might look something like this:
-----------Cut here-------------------------------
window @MyWindow "My First Window" {
menuBar {
menu "File" {
menuItem @New "New"
menuItem @Exit "Exit"
}
menu "Help" {
menuItem @About "About..."
}
}
colLayout {
rowLayout {
label "First row!"
button @Button1 "Press me"
button @Button2 "And me"
}
rowLayout {
label "Which units:"
radioButton @inchRB "inches"
radioButton @feetRB "feet"
radioButton @yardRB "yards"
radioButton @mileRB "miles"
}
}
}
-----------Cut here-------------------------------
Then you invoke the Parrot executable: this causes Parrot to
create a file containing source code which, when executed, will
display your GUI window.
What language is Parrot's output written in? That depends on
which _backend_ you use.
Parrot is written in two parts: a frontend, which reads in a
*.par file, like the one shown above, storing it in an
internal data format; and a backend, which converts the internal
format into code for output.
I intend that multiple backends will be written for Parrot; this
has two advantages:
1. someone will be able to learn one GUI builder, Parrot, and
then use that tool for whatever programming language they
are using
2. a GUI application created in Parrot can be translated into
several output formats, e.g. if there is a prototype in
one language and the real application in another; or if
one is porting to a different OS or GUI toolkit.
Currently (Parrot-0.2.0), there are 3 backends:
Html - creates a page of HTML
Paxo - outputs file in Parrot XML Output format
Pytk - creates *.py file which uses the Tkinter API
Planned backends include:
* the Glade XML format (Glade is a graphical GUI builder which is
part of the GNOME project; a Glade XML file can be used to build
GNOME applications).
* C++ using the Qt GUI library
Parrot will also be able to read the Glade XML format and use it
to write *.par files. This means that Parrot should be interoperable
with Glade -- someone could use the two together to build a GUI.
Anyone wishing to contribute other backends will be welcome to do
so; hopefully Parrot will eventually encompass all GUI APIs and
prgramming languages in common use. Note that if a GUI toolkit
doesn't have a visual builder, and someone writes a Parrot backend
for that toolkit, then once the Glade XML->parrot translator has
been written, people will be able to design their GUI in Glade and
then use Parrot to create code targeted at the GUI toolkit they are
using.
Parrot is written in Python. It is copyrighted by philip Hunt and
licenced under the GNU GPL. Parrot uses version 0.4 of John Aycock's
parsing framework described in his paper _Compiling Little Languages
in Python_.
Parrot is currently *pre-alpha* software. So don't expect to do useful
work with it yet.
;end