finder find_file

I am using a template from manpce/XPCE examples/Menu Bar
message(V, load, @finder?file)) don’t open the file viewer
get(@finder, file, @on, *, File) do it easily but I cannot use get
into send_list.
Obviously it is waiting for arguments (@on *) but just see @default/constant.
So how to to pass arguments to finder object file method ?
Default file at xpce root seems to work only for class variables.
Also this makes Prolog crashing:

  • trying to trace with guitracer
  • opening edit. , compile buffer and execute → Prolog crash
    no crash if I compile from console.
    Win10 64 bits tested with last Prolog stable release 32 and 64 bits.
    thanks for your help.

It works if you use this:

           message(V, load, ?(@finder, file, open))),

There was bug in the finder for dealing with an unspecified (default mode). Pushed a fix. That should be in tomorrows daily download. It will take quite a while before a next stable version is released.

The xpce gui system is more or less end-of-life. It is likely to be maintained for quite a while, but nothing was improved since many years. To make the example work you must add

:- use_module(library(pce)).

at the top and start using initialization/1 rather than using :- directly:

:- initialization(menu_bar_demo).

As for the crash, that is mostly likely related to xpce which by default runs the tools in a thread (called pce). Part of the IDE running in a thread and your application started from the main thread is likely to give problems. Use

 :- set_prolog_flag(xpce_threaded, false).

before anything graphic related, i.e., before loading library(pce). When in doubt, run

?- threads.

to check the running threads. When developing an application using xpce this should list main and (probably) gc, but not pce.

all works fine and no crash.