| Did you know ... | Search Documentation: |
| Send methods |
-version -system->forward
behaviour->forward, put pushing and popping
the argument stack outside the loop.send() virtual machine operation<-cpu_time|chain]<-last_error.
The method pce->catch_pop
restores the catched errors to the state before invoking pce->catch_error.
The prolog predicate pce_catch_error/2 provides an interface:
?- send(@pce, hello, pce).
[PCE error: send: No implementation for: @pce/pce ->hello
in: send(@pce/pce, hello, pce)]
PCE: 1 fail: send(@pce/pce, hello, pce) ?
While
?- pce_catch_error(no_behaviour,
send(@pce, hello, pce)).
No
After which
?- get(@pce, last_error, E). ==> E = no_behaviour
Note that errors with pce<-feedback:
throw can also be handled using Prolog exception-handling.
->catch_pop ->catched -catched_errors ->catch_error’.
->catch_error ->catch_error ->confirm
on
@display.
Otherwise the text is formatted on the terminal and PCE requests the
user to type y or n. Used infrequently.
->inform ->confirmxterm(1) application. The latter is
verified by checking the environment variable TERM for the value xterm.
See also pce->show_console.absolute_position Translation of relative coordinates allocate memory allocation compute Graphicals ->request_compute and ->compute cursor Determining visual cursor dialog Dialog layout editor Various editor happenings event Various things with events fill Filling text (editor) flash Flashing graphicals float Floating point conversions focus Event focusing fragment Fragment handling frame Various frame events gc Incremental garbage collection get_xref Maintenance of X id database image Some image functions clone Cloning objects menu Menu repaint message Execution of message objects obtain Failing obtainers path Smoothing paths popup Popup menu's post Event posting (event ->post) postscript PostScript generation process Actions on handling subprocesses redraw Repaint management save `Object ->save_in_file` scan `char_array <-scan` scroll Scrollbar handling shift text_image shifting of lines spatial execution of spatial constraints text Updating of text_images undo Undo in text_buffers xref X window references database
pce->nodebug_subject
removes an item from this list.
User code may exploit the same mechanism and test whether debugging a
subject is enabled using pce->debugging_subject.
->open ->nodebug_subject ->debug->debug_subject
and pce<-debugging
is @on. This
test may be used in application code to exploit this debugging mechanism
of XPCE.
In a runtime system this method is available, but fails always.
code
when an action is performed that requires details of the class (such as
creating an instance).
All, except for some vital kernel classes of XPCE itself have been declared this way to delay/avoid building the class-definitions.
See also class->realise.
hostAction(HOST_HALT). With a completely
implemented interface, this in return will call PCE's cleanup functions
registered with
hostAction(HOST_ONHALT) and terminate the process.exit() with the
argument status.
With a proper implemented interface, the normal termination will
execute the pce<-exit_messages,
kill possible subprocesses and terminate the process. The termination
process is the same regardless of whether the
host-language
terminate functions is called or pce->die
is invoked.
Defaults: The default termination status is 0 (indicating success).
-exit_messages<-exception_handlers.
Bugs: The exception mechanism is rudimentaly.
<-convert <-instance -exception_handlers<-exit_messages.
That is: the last exit message registered will be executed the first.
-exit_messages->show_console:
open.
Expose the console window of XPCE. Only implemented for the
MS-Windows version. See also pce->console_label.
->succeed-features
This method is safe: the name-base may be manipulated during its
execution. Tbe code will not be executed for named added during the
execution of pce->for_name.
.g. @pce, @arg1).
The exit status of the code is ignored. Arguments:
@arg1 Name of the global object (e.g. `pce`, `arg1`).
This method passes the reference-names rather than the objects themselves. As various of them are functions, good understanding of the expansion-rules for functions is necessary.
<-object_from_reference ->rename_reference
?- send(@classes, for_all,
message(@pce, format, '%s\t%s\n',
@arg1, @arg2)).
See string->format
for a description of the format specification.
->show_console:
iconic.-version->inform.
Otherwise pce->format
the information on the terminal.
->inform ->confirm<-core_wasted.
<-core_wasted<-defaults.
A Defaults file consists of statements. Each statement is on a
seperate line. A statement may be split over several lines by preceeding
the newline with a backslash (\). The exclamation mark (\!)
is the line-comment character. All input from a ! upto the following
newline is replaced by a single space-character. Empty lines or lines
containing only blank space are ignored.
Default files may include other default files using the statement
<class>.<class-variable>: <value>
Where <class> denotes the name of the class, or * to indicate
the default applies for any class defining this class-variable. If both
forms are found, the statement with the explicit class-name
is used. <class-variable> denotes the class-variable name. <value>
is the default value of the class-variable. The syntax for <value>
is similar to the arguments of send/[2-12]. The (informal) syntax for <value>
is below.
<Any> := <int>
| <float>
| <Name>
| @<Name>
| <Chain>
| <Object>
<Chain> := [ <Any> {, <Any>} ]
| [ {<Blank>} ]
<Object> := <ClassName>()
| <ClassName>(<Any> {, <Any>})
| <PrefixOp> <Any>
| <Any> <InfixOp> <Any>
| <Any> <PostfixOp>
| "<String>"
<String> := {<CharNotDoubleQuote>|""}
<Name> := <Letter>{<Letter>|<Digit>}
| '{<CharNotSingleQuote>|''}}'
-language
interface at initialisation time if the
host-language
wishes to access XPCE from multiple threads. The
host-language
interface should use the functions pceMTLock() and
pceMTUnlock() as wrappers around access to XPCE.
This method fails with an error when invoked too late (for the X11 version this implies after the window system has been initialised). It fails silently if this version of XPCE is not compiled to support multi-threading.
XPCE multi-threading support is currently rather limited: it consists
of one global recursive mutex that ensures the system is
activated in a single-thread only. This mutex should be locked by the host-language
around access to the basic operations (send, get, new and
object) and is locked by XPCE itself for any event processed.
XPCE call-back occurs in the thread waiting for events. In the normal
XPCE/Prolog context this is the main-thread. As the system is locked
during event-processing, smooth interactive operation requires
event-processing to be completed quickly. If an event causes a long
operation to start the host-language
should run this operation in another thread.
->debug_subject
->debug_subject->name_reference.
->name_reference ->for_name_referencehostQuery(HOST_CONSOLE) request. The meaning of
the argument:
library(pce_main)
for some standard predicates to realise the toplevel control loop).new(@succeed, message(@pce, succeed)).
Note that the following is faster:
new(@succeed, new(and)).
->fail-language
keywords are most naturally mapped on PCE-names. This method, which is
normally send by the LISP interface right after PCE has been initialised
performs the following actions:
Defaults: The default word separator is’_’(unchanged).
Bugs: To get compatible resource-handling, resources defined
as type name will be mapped to uppercase (and have their
word-separator changed) when converted. Also, generated
object-identifiers (for fonts, classes, etc.) will be mapped to
upper-case. The run-time generated keywords may lead to unexpected
behaviour.
Finally, when converting of a bitmap- or image-name
to a filename, the name is downcased. This makes it implossible to use
automatic conversion when the file-name
consists of uppercase characters.
->syntax->write_ln->write
and terminates the line with a newline. Useful for dumping information
to the terminal:
send(@images, for_all, message(@pce, write_ln, @arg1, @arg2)).
Dumps a map of all named image objects (which is initially empty).
->write