1XPCE(1) General Commands Manual XPCE(1)
2
3
4
6 xpce - Prolog with graphical user interface (GUI)
7
9 xpce prolog-option ...
10
12 XPCE is a language independent library for GUI (Graphical User Inter‐
13 faces). This manual page discusses XPCE/Prolog: the combination of a
14 Prolog environment and XPCE.
15
16 XPCE is an object-oriented engine that can have methods defined in var‐
17 ious languages. XPCE has about 150 predefined classes that deal mainly
18 with GUI's. The object engine of XPE is made available to Prolog using
19 the following predicates:
20
21 Predicates:
22 new(?Ref, +Term)
23 Create an XPCE object from Term and bind the object to the ref‐
24 erence Ref. The functor-name of Term describes the class from
25 which to create an instance. The arguments of Term are used as
26 initialisation arguments for the new object. If the object was
27 created successfully and Ref is a variable, Ref will be unified
28 with the term @<RefNumber>. If Ref is a term of the form
29 @<Atom>, this term will serve as a reference for the new object.
30
31 For example ?- new(@p, picture('Hello World'). Creates a graph‐
32 ical window object with title "Hello World".
33
34 send(+Ref, +Selector, +Args...)
35 Ref is a reference to an existing XPCE object. Selector is the
36 name of a (send-)method defined on (the class of) this object
37 and Args are terms that describe arguments to be passed to the
38 method.
39
40 send/[2-12] will convert the arguments to XPCE data objects,
41 resolve the procedure (C-function, Prolog predicate) implement‐
42 ing the method and run the implementation. If the execution is
43 successful, send succeeds, otherwise send fails.
44
45 For example ?- send(@p, open, point(400,100)). opens the pic‐
46 ture created above at position 400,100 on the display.
47
48 get(+Ref, +Selector, +Args ..., -Value)
49 Ref is a reference to an existing XPCE object. Selector is the
50 name of a (get-)method defined on (the class of) this object and
51 Args are terms to provide additional arguments. get/[3-13]
52 works similar as send/[2-12] but returns a value rather than
53 succeeding/failing (boolean operation).
54
55 For example get(@p, height, H). Unifies H with the height of
56 the graphical window.
57
58 free(+Ref)
59 If Ref is a reference to an XPCE object, invoke send(Ref, free).
60 to the object. Otherwise succeed silently.
61
63 XPCE's web-home at http://www.swi.psy.uva.nl/projects/xpce/
64
65 Jan Wielemaker and Anjo Anjewierden Programming in XPCE/Prolog, Univer‐
66 sity of Amsterdam, Dept. of Social Science and Informatics (SWI).
67
68 Jan Wielemaker SWI-Prolog 4.0 Reference Manual. Available from the
69 SWI-Prolog web-home at http://www.swi.psy.uva.nl/projects/SWI-Prolog/
70
71 The online manual system started with ?- manpce. or ?- user_help on
72 Quintus or SICStus Prolog.
73
74 The XPCE WWW home page: http://swi.psy.uva.nl/projects/xpce/home.html
75
76 xpce-client(1), pl(1)
77
79 XPCE is distributed under the General Public Licence version 2, also
80 known as the GPL-2 licence. The license terms are in the file COPYING
81 or on the GNU website at http://www.gnu.org.
82
83 In a nutshell, you can modify and use XPCE as long as you clearly indi‐
84 cate changes, don't change copyright messages and distribute the com‐
85 plete source of your work with every binary copy or make the source in
86 some other form available for free to your users
87
88 Especially if you do not wish to distribute the source of your work you
89 may wish to consider optaining a commercial license. Please visit the
90 SWI-Prolog home-page for details.
91
93 Copyright (c) 1985-2001 University of Amsterdam. XPCE may be distrib‐
94 uted under the terms of the "Simplified BSD license".
95
97 Jan Wielemaker and Anjo Anjewierden
98
99
100
101 February 7, 2001 XPCE(1)