4.35.3 Controlling the swipl-win.exe console window
The Windows executable swipl-win.exe console has a number of predicates to control the appearance of the console. Being totally non-portable, we do not advise using it for your own application, but use XPCE or another portable GUI platform instead. We give the predicates for reference here.
- window_title(-Old, +New)
- Unify Old with the title displayed in the console and change
the title to New.bugThis
predicate should have been called
win_window_title
for consistent naming. - win_window_pos(+ListOfOptions)
- Interface to the MS-Windows SetWindowPos() function, controlling size,
position and stacking order of the window. ListOfOptions is a
list that may hold any number of the terms below:
- size(W, H)
- Change the size of the window. W and H are expressed in character units.
- position(X, Y)
- Change the top-left corner of the window. The values are expressed in pixel units.
- zorder(ZOrder)
- Change the location in the window stacking order. Values are
bottom
,top
,topmost
andnotopmost
. Topmost windows are displayed above all other windows. - show(Bool)
- If
true
, show the window, iffalse
hide the window. - activate
- If present, activate the window.
- win_window_color(+Which, +RGB)
- Change the color of the console window. Which is one of
foreground
,background
,selection_foreground
orselection_background
. RGB is a termrgb(Red,Green,Blue)
where the components are values between 0 and 255. The defaults are established using the Windows API GetSysColor(). - win_has_menu
- True if win_insert_menu/2 and win_insert_menu_item/4 are present.
- win_insert_menu(+Label, +Before)
- Insert a new entry (pulldown) in the menu. If the menu already contains
this entry, nothing is done. The Label is the label and,
using the Windows convention, a letter prefixed with
&
is underlined and defines the associated accelerator key. Before is the label before which this one must be inserted. Using
adds the new entry at the end (right). For example, the call below adds an Application entry just before the Help menu.-
win_insert_menu('&Application', '&Help')
- win_insert_menu_item(+Pulldown, +Label, +Before, :Goal)
- Add an item to the named Pulldown menu. Label and
Before are handled as in win_insert_menu/2,
but the label
inserts a separator. Goal is called if the user selects the item.-