All Manuals > CAPI User Guide and Reference Manual > 21 CAPI Reference Entries

force-dark-mode Function

Summary

Tells LispWorks whether to display in dark mode (GTK+ only).

Package

capi

Signature

force-dark-mode value &key screen

Arguments
value
:yes, :no or nil.
screen
A screen, or any argument accepted by convert-to-screen.
Description

The function force-dark-mode can be used to tell LispWorks on GTK+ to display as if in dark or not in dark mode.

By default, LispWorks tries to detect whether to use dark mode or not. force-dark-mode is intended to be used in setups when LispWorks does not detect the mode correctly, to force using or not using dark mode.

If value is nil, force-dark-mode sets the state back to the default. If value is :yes, force-dark-mode forces dark mode, and if :no forces light mode.

If screen is not supplied, force-dark-mode sets the default initial state of any CAPI screen that is created after the call. This state is persistent, including over saving an image by save-image or delivering by deliver. A call without screen does not require any previous initialization, so can be used in initialization files and in scripts used for building applications.

When screen is supplied, it must be a screen, or any argument accepted by convert-to-screen. force-dark-mode sets the state for the result of convert-to-screen.

Notes

force-dark-mode has an effect only on GTK+. It can work successfully only if the user's desktop is set up correctly to switch between modes.

In general, force-dark-mode is intended to be used to match the actual mode of the desktop that LispWorks displays on. For force-dark-mode to work without matching the desktop, you will need to set the colors of the panes in your application.

By default, most of the colors in CAPI are chosen from the underlying GTK+ interface:

On GTK+ 3, LispWorks uses the color-scheme from the gsettings object with schema_id "org.gnome.desktop.interface" to check for the mode, which gives the setting on the machine that LispWorks runs on. A typical use case of force-dark-mode is when LispWorks is displaying on another machine that has a different color-scheme.

After using force-dark-mode on a screen, newly created windows should be colored according to value. Windows that already exist may or may not switch correctly.

See also

create-light-dark-switchable-color
top-level-interface-dark-mode-p


CAPI User Guide and Reference Manual (Windows version) - 18 Feb 2025 15:35:34