> Some time ago I answered this question (
> and wrote this snippet:
> :- use_module(library(pce)).
> :- use_module(library(plot/barchart)).
> :- use_module(library(autowin)).
> test_barchart :-
> new(W, picture),
> send(W, display, new(BC, bar_chart(vertical,0,200))),
> [x/100/red, y/150/green, z/80/blue, v/50/yellow]),
> ( new(B, bar(Name, Height)),
> send(B, colour(Color)),
> send(BC, append, B)
> send(W, open).
> Now I tried again that code, and I was left to stare at a blinking cursor
> on an empty line...
> After some test I found that commenting out, in ~/.plrc
> :- set_prolog_flag(xpce_threaded, true).
> it worked again. I feel the problem it's over my head...
XPCE isn't very good at threading. Worse, the problems are quite
different on Windows and X11, while the Mac has its own problems ...
So, run it in a single thread and communicate with it using
in_pce_thread/1 and in_pce_thread_sync/1 from other threads.
If you use the xpce_threaded flag, it will settle itself on a
thread named `pce`, which is great for development as the development
system remains responsive while your application runs. If you want to
do *xpce development*, it is probably wiser to keep xpce in the main
thread. Once you are finished, you can revert to threaded mode and
use ?- in_pce_thread(start_my_app). to launch the application.
Hope this clarifies a bit. My $0.002: write graphical applications
as web applications. Looks better, good portability, network
transparency if you need it, etc.