Windows 10 shortcut to run a program that uses XPCE

Skip to first unread message

Pasi Xyy

Sep 21, 2017, 11:15:53 AM9/21/17
Running a program using a XPCE-library that would hide the toplevel-window (window that shows a prompt) and display the window  that is created using XPCE-predicates is not easy. There could be a simpler way, I am not sure.

Make a shortcut where,
  • Target is "C:\Program Files (x86)\Swipl\bin\swipl-win.exe" -s your_module -g pce_main_loop(your_module:mainwin)
  • Working folder is the folder where your_module is located
  • Choose minimized for the toplevel-window ( I haven't figured out how to completely not show the toplevel-window, this could be a security risk?? )

You now should have a shortcut that opens your XPCE-program but it has two windows. The toplevel window is in minimized state and the 2nd window should be visible. When closing the visible window also the toplevel gets closed.

I did have a simpler way to run from shortcut. The pce_main_loop/1 was called inside the, but many Swipl.exe-versions ago the toplevel window stopped closing with the XPCE-program window. I don't remember what version started this behaviour.

I have 7.5.13 version of Swi-Prolog. The xpce_threaded-flag makes no difference. I haven't tried the qsave_program/1 stuff. I hope this helps those who likes to have their hobby stuff to start from shortcut :) Thanks.

Reply all
Reply to author
0 new messages